CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.h

Go to the documentation of this file.
00001 #ifndef EcalABAnalyzer_h_
00002 #define EcalABAnalyzer_h_
00003 
00004 // $Id: EcalABAnalyzer.h
00005 
00006 #include <memory>
00007 #include <vector>
00008 #include <map>
00009 
00010 #include <FWCore/Framework/interface/EDAnalyzer.h>
00011 
00012 class TShapeAnalysis;
00013 class TAPDPulse;
00014 class TMom;
00015 
00016 // Define geometrical constants 
00017 // NOT the same for "EB" and "EE"
00018 //
00019 //     "EB"       "EE"
00020 //
00021 //      0          0
00022 //   1     2    1     2
00023 //   3     4
00024 //   5     6
00025 //   7     8 
00026 //
00027 // 
00028 
00029 // "EB" geometry
00030 #define NCRYSEB    1700  // Number of crystals per EB supermodule
00031 
00032 // "EE" geometry 
00033 #define NCRYSEE    830   // Number of crystals per EE supermodule
00034 
00035 class EcalABAnalyzer: public edm::EDAnalyzer{  
00036 
00037  public:
00038   
00039   explicit EcalABAnalyzer(const edm::ParameterSet& iConfig);  
00040   ~EcalABAnalyzer();
00041   
00042   
00043   virtual void analyze( const edm::Event & e, const  edm::EventSetup& c);
00044   virtual void beginJob();
00045   virtual void endJob();
00046   
00047   
00048   enum VarCol   { iBlue, iRed, nColor }; 
00049   
00050  private:
00051   
00052   int iEvent;
00053   
00054   
00055   // Framework parameters
00056   
00057   unsigned int  _nsamples;
00058   unsigned int  _presample;
00059   unsigned int  _firstsample;
00060   unsigned int  _lastsample;
00061   unsigned int  _timingcutlow;
00062   unsigned int  _timingcuthigh;
00063   unsigned int  _timingquallow;
00064   unsigned int  _timingqualhigh;
00065   double        _ratiomincutlow;
00066   double        _ratiomincuthigh;
00067   double        _ratiomaxcutlow;
00068   double        _presamplecut;
00069   unsigned int  _niter ;
00070   double        _alpha ;
00071   double        _beta;
00072   unsigned int  _nevtmax;
00073   double        _noise;
00074   double        _chi2cut;
00075   std::string   _ecalPart;
00076   int           _fedid;
00077   double        _qualpercent;
00078   int           _debug;
00079   
00080   TAPDPulse *APDPulse;
00081   TMom *Delta01;
00082   TMom *Delta12;
00083   
00084   std::string  resdir_;
00085   std::string  digiCollection_;
00086   std::string  digiProducer_;
00087   std::string  eventHeaderCollection_;
00088   std::string  eventHeaderProducer_;
00089   
00090   // Output file names
00091   
00092   std::string  alphafile;
00093   std::string  alphainitfile;
00094 
00095   TShapeAnalysis *shapana;
00096   unsigned int nevtAB[NCRYSEB];
00097   
00098   //  Define geometrical constants
00099   //  Default values correspond to "EB" geometry (1700 crystals)
00100   
00101   unsigned int nCrys;
00102   bool doesABTreeExist;
00103     
00104   bool          _fitab;
00105   // Identify run type
00106   
00107   int runType;
00108   int runNum;
00109   int fedID;
00110   int dccID;
00111   int side;
00112   int lightside;
00113   int iZ;
00114   
00115   
00116   // Temporary root files and trees
00117   
00118   std::vector<int> colors;
00119   std::map<int, int> channelMapEE;
00120   std::vector<int> dccMEM;
00121   std::vector<int> modules;
00122   
00123   
00124   // Declaration of leaves types for temporary trees
00125   
00126   int             phi, eta;
00127   int             event ;
00128   int             color ;
00129   double          adc[10];
00130   int             adcG[10];
00131   int         channelIteratorEE;
00132   
00133   
00134   int iEta[NCRYSEB],iPhi[NCRYSEB];
00135   int iTowerID[NCRYSEB],iChannelID[NCRYSEB], idccID[NCRYSEB], iside[NCRYSEB];
00136   
00137   // Quality Checks variables and flags
00138   
00139   int nEvtBadGain[NCRYSEB];
00140   int nEvtBadTiming[NCRYSEB];
00141   int nEvtTot[NCRYSEB];
00142 
00143   bool          wasGainOK[NCRYSEB];
00144   bool          wasTimingOK[NCRYSEB];
00145   
00146   bool          isGainOK;
00147   bool          isTimingOK;
00148   
00149 };
00150 
00151 #endif
00152 
00153