Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-03 23:51:39

0001 // $Id: EcalMatacqAnalyzer.h
0002 
0003 #include <memory>
0004 #include <FWCore/Framework/interface/one/EDAnalyzer.h>
0005 
0006 class TFile;
0007 class TTree;
0008 class TMTQ;
0009 
0010 #define N_samples 2560
0011 #define N_channels 1
0012 #define NSIDES 2  // Number of sides
0013 
0014 class EcalMatacqAnalyzer : public edm::one::EDAnalyzer<> {
0015 public:
0016   explicit EcalMatacqAnalyzer(const edm::ParameterSet &iConfig);
0017   ~EcalMatacqAnalyzer() override;
0018 
0019   void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0020   void beginJob() override;
0021   void endJob() override;
0022 
0023   enum VarCol { iBlue, iRed, nColor };
0024   enum VarSide { iSide0, iSide1, nSide };
0025 
0026 private:
0027   int iEvent;
0028 
0029   //
0030   // Framework parameters
0031   //
0032 
0033   double _presample;
0034   unsigned int _nsamplesaftmax;
0035   unsigned int _noiseCut;
0036   unsigned int _parabnbefmax;
0037   unsigned int _parabnaftmax;
0038   unsigned int _thres;
0039   unsigned int _lowlev;
0040   unsigned int _highlev;
0041   unsigned int _nevlasers;
0042   unsigned int _timebefmax;
0043   unsigned int _timeaftmax;
0044   double _cutwindow;
0045   unsigned int _nsamplesshape;
0046   unsigned int _presampleshape;
0047   unsigned int _slide;
0048   int _fedid;
0049   int _debug;
0050 
0051   std::string resdir_;
0052   std::string digiCollection_;
0053   std::string digiProducer_;
0054   std::string eventHeaderCollection_;
0055   std::string eventHeaderProducer_;
0056 
0057   std::string outfile;
0058   std::string sampfile;
0059 
0060   // Identify run type
0061 
0062   unsigned int nSides;
0063   int lightside;
0064   int runType;
0065   int runNum;
0066   int dccID;
0067   int fedID;
0068 
0069   // Count Laser Events
0070   int laserEvents;
0071   bool isThereMatacq;
0072 
0073   //Declaration of leaves types
0074 
0075   int event;
0076   int color;
0077   double matacq[N_samples];
0078   int maxsamp;
0079   int nsamples;
0080   double tt;
0081 
0082   TFile *sampFile;
0083   TTree *tree;
0084 
0085   TMTQ *MTQ[nColor][nSide];
0086   TTree *meanTree[nColor];
0087 
0088   std::vector<int> colors;
0089 
0090   TFile *outFile;
0091   int status;
0092   double peak, sigma, fit, ampl, trise, fwhm, fw20, fw80, ped, pedsig, ttrig, sliding;
0093   TTree *mtqShape;
0094 };