Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:11

0001 #ifndef __groot_H__
0002 #define __groot_H__
0003 
0004 
0005 //

0006 //  Hello TPC Fans :P

0007 //

0008 //    Welcome to groot.  groot is the code to analyze SLAC

0009 //  test beam data.  It gets its name form the highly non-uniform

0010 //  namture of the MPC-EX and also the test beam apparatus.

0011 //

0012 //    If this code were written for PHENIX, data objects 

0013 //  (Blobs, Clusters, etc) would be <vector> located in a PHENIX "Node Tree" 

0014 //  (linked list).  Since TESTBEAM is not PHENIX, we have  TEMPORARILY(!!!) located 

0015 //  these objects inside groot.

0016 //

0017 //    This file principally declares vectors of object types that are essential to the 

0018 //  pattern recognition itself.

0019 //

0020 //    The thing that distinguishes groot from legolas is the inclusion of

0021 //  the two trackers but exclusion of the RICH.  The trackers will be used to define 

0022 //  the vectors coming from the tracks and thereby define the places of shower

0023 //  centers and also the number of electrons. 

0024 //

0025 //

0026 //                                                TKH

0027 //                                                2-27-2014

0028 //

0029 
0030 #include <vector>
0031 #include <string>
0032 #include <map>
0033 #include "TRandom.h"
0034 
0035 #include "params.h"
0036 
0037 // Forward declarations...

0038 class ATrace;
0039 class ABlob;
0040 class ATrack;
0041 class AZigzag;
0042 class Event;
0043 class TH1;
0044 
0045 class groot
0046 {
0047  public:
0048   static groot *instance()
0049   {
0050     if (__instance) 
0051       {
0052     return __instance;
0053       }
0054     else
0055       {
0056     __instance = new groot();
0057     return __instance;
0058       }
0059   }
0060   virtual ~groot();
0061 
0062   /* BEAMLINE Counters */
0063   std::vector<ATrace*>   theTraces;
0064 
0065   /* Tracker */
0066   std::vector<AZigzag*>  theZigzags;
0067   std::vector<ABlob*>    theBlobs[Nr];
0068 
0069   //  To allow easy access at the prompt...

0070   ABlob* AccessBlobs[Nr][10];
0071   int    BlobCount[Nr];
0072   void   FillAccessBlobs();
0073 
0074 
0075   /* Tracker combined */
0076   std::vector<ATrack*>   theTracks;
0077 
0078   Event* event;
0079 
0080   std::vector<TH1*> theHistograms;
0081 
0082   // Utility Functions...

0083   void Report();
0084   void ClearTheDetector();
0085   void SaveTheHistograms(std::string filename);
0086 
0087   TRandom Randy;
0088 
0089   // ZZM[r][phi] is an ORDERED set of pointers to the Zigzags

0090   // WM[WaveformIndex] is a pointer to a Zigzag in waveform order (used to suppress crosstalk).

0091   AZigzag* ZigzagMap2[Nr][Nphi];
0092   AZigzag* ZigzagMap[Nsrs];
0093   AZigzag* ZWaveMap[Nsrs];  
0094 
0095 protected:
0096   groot();
0097   static groot *__instance;
0098 
0099   void CreateZigzags();
0100   void FillZigzagMaps();
0101   void CreateZigzagMaps();
0102   void FindNeighbors();
0103 
0104   //  demapper[MartinIndex] = WaveformIndex

0105   //  remapper[WaveformIndex] = MartinIndex

0106   int demapper[128];
0107   int remapper[128];
0108 
0109   std::map<std::string,std::string> Padplane_NameToConnector;
0110   std::map<std::string,std::string> Padplane_NameToSamPin;
0111 
0112   std::map<std::string,int> PanSam_SamPinToPanPin;
0113 
0114   //  Accepts SBU panasonic numbering as input.

0115   //  Returns true APV channel number...

0116   int PanPinToChannel(int PanPin);
0117 
0118   //  This takes a connector like U$1 and tells you the hybrid index...

0119   int ConnectorToHybrid(std::string Conn);
0120 
0121 };
0122 
0123 #endif /* __groot_H__ */