CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.h

Go to the documentation of this file.
00001 // $Id: EcalTestPulseAnalyzer.h,v 1.6 2012/02/09 10:07:37 eulisse Exp $
00002 
00003 #include <memory>
00004 #include <FWCore/Framework/interface/EDAnalyzer.h>
00005 
00006 class TFile;
00007 class TTree;
00008 
00009 // Define geometrical constants 
00010 // NOT the same for "EB" and "EE"
00011 //
00012 //     "EB"       "EE"
00013 //
00014 //      0          0
00015 //   1     2    1     2
00016 //   3     4
00017 //   5     6
00018 //   7     8 
00019 //
00020 // 
00021 // "EB" geometry
00022 // "EB" geometry
00023 #define NCRYSEB    1700  // Number of crystals per EB supermodule
00024 #define NTTEB      68    // Number of EB Trigger Towers   
00025 #define NMODEB     9     // Number of EB submodules
00026 #define NPNPERMOD  2     // Number of PN per module
00027 
00028 // "EE" geometry 
00029 #define NCRYSEE    830   // Number of crystals per EE supermodule
00030 #define NTTEE      68    // Number of EE Trigger Towers   
00031 #define NMODEE     21     // Number of EE submodules
00032 
00033 #define NGAINPN    2     // Number of gains   
00034 #define NGAINAPD   4     // Number of gains 
00035 
00036 
00037 class EcalTestPulseAnalyzer: public edm::EDAnalyzer{  
00038 
00039  public:
00040   
00041   explicit EcalTestPulseAnalyzer(const edm::ParameterSet& iConfig);  
00042   ~EcalTestPulseAnalyzer();
00043   
00044   
00045   virtual void analyze( const edm::Event & e, const  edm::EventSetup& c);
00046   virtual void beginJob();
00047   virtual void endJob();
00048   
00049   
00050  private:
00051   
00052   int iEvent;
00053   
00054   // Framework parameters
00055     
00056   unsigned int  _nsamples;
00057   unsigned int  _presample;
00058   unsigned int  _firstsample;
00059   unsigned int  _lastsample;
00060   unsigned int  _samplemin;
00061   unsigned int  _samplemax;
00062   unsigned int  _nsamplesPN;
00063   unsigned int  _presamplePN;
00064   unsigned int  _firstsamplePN;
00065   unsigned int  _lastsamplePN;
00066   unsigned int  _niter ;
00067   double        _chi2max ;
00068   double        _timeofmax ;
00069   std::string   _ecalPart;
00070   int           _fedid;
00071   
00072   std::string  resdir_;
00073   std::string  digiCollection_;
00074   std::string  digiPNCollection_;
00075   std::string  digiProducer_;
00076   std::string  eventHeaderCollection_;
00077   std::string  eventHeaderProducer_;
00078    
00079 
00080   // Output file names
00081 
00082   std::string  rootfile;
00083   std::string  resfile;
00084 
00085   //  Define geometrical constants
00086   //  Default values correspond to "EB" geometry (1700 crystals)
00087 
00088   unsigned int nCrys;
00089   unsigned int nTT;
00090   unsigned int nMod;
00091   unsigned int nGainPN;
00092   unsigned int nGainAPD;
00093 
00094   
00095   // Count TP Events
00096   int TPEvents;
00097 
00098   double ret_data[20];
00099 
00100   int towerID;
00101   int channelID;
00102 
00103   // Identify run 
00104 
00105   int runType;
00106   int runNum;
00107   int fedID;
00108   int dccID;
00109   int side;
00110   int iZ;
00111 
00112     
00113   // Root Files
00114  
00115   TFile *outFile; // from 'analyze': Data
00116   TFile *resFile; // from 'endJob': Results
00117 
00118 
00119   // Temporary data trees 
00120 
00121   TTree *trees[NCRYSEB];
00122 
00123   // Declaration of leaves types
00124   
00125   int             phi, eta;
00126   int             event ;
00127   double          adc[10] ;
00128   double          pn[50] ;
00129 
00130   int             apdGain;
00131   int             pnGain;
00132   int             pnG;
00133   double          apdAmpl;
00134   double          apdTime;
00135   double          pnAmpl0;
00136   double          pnAmpl1;
00137   double          pnAmpl;
00138 
00139 
00140   // Results trees 
00141 
00142   TTree *restrees;
00143   TTree *respntrees;
00144 
00145 
00146   std::map<int, int> channelMapEE;
00147   std::vector<int> dccMEM;
00148   std::vector<int> modules;
00149 
00150 
00151   // Declaration of leaves types 
00152 
00153   int ieta, iphi, flag, gain;
00154   int pnID, moduleID;
00155   int channelIteratorEE;
00156   double APD[6], PN[6];
00157 
00158   int iEta[NCRYSEB],iPhi[NCRYSEB];
00159   unsigned int iModule[NCRYSEB];
00160   int iTowerID[NCRYSEB], iChannelID[NCRYSEB], idccID[NCRYSEB], iside[NCRYSEB];
00161 
00162   unsigned int firstChanMod[NMODEB];
00163   unsigned int isFirstChanModFilled[NMODEB];
00164 
00165 
00166 };
00167 
00168