File indexing completed on 2024-04-06 11:57:49
0001
0002
0003 #include <memory>
0004 #include <FWCore/Framework/interface/one/EDAnalyzer.h>
0005 #include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
0006 #include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
0007
0008 class TTree;
0009 class TFile;
0010
0011 #define N_samples 2560
0012 #define N_channels 1
0013
0014 class EcalPerEvtMatacqAnalyzer : public edm::one::EDAnalyzer<> {
0015 public:
0016 explicit EcalPerEvtMatacqAnalyzer(const edm::ParameterSet& iConfig);
0017 ~EcalPerEvtMatacqAnalyzer() override = default;
0018
0019 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0020 void beginJob() override;
0021 void endJob() override;
0022
0023 private:
0024 std::string outfile;
0025
0026 int iEvent;
0027
0028
0029
0030 int runType;
0031 int runNum;
0032
0033
0034
0035 int event;
0036 int laser_color;
0037 double matacq[N_samples];
0038 unsigned int maxsamp;
0039 unsigned int nsamples;
0040
0041 TFile* sampFile;
0042 TTree* tree;
0043
0044 int IsFileCreated;
0045 int IsTreeCreated;
0046 TFile* outFile;
0047 int status;
0048 double peak, sigma, fit, ampl, trise, ttrig;
0049 TTree* mtqShape;
0050
0051 private:
0052
0053
0054
0055
0056 const double _presample;
0057 const unsigned int _nsamplesaftmax;
0058 const unsigned int _nsamplesbefmax;
0059 const unsigned int _noiseCut;
0060 const unsigned int _parabnbefmax;
0061 const unsigned int _parabnaftmax;
0062 const unsigned int _thres;
0063 const unsigned int _lowlev;
0064 const unsigned int _highlev;
0065 const unsigned int _nevlasers;
0066
0067 const std::string resdir_;
0068 const std::string digiCollection_;
0069 const std::string digiProducer_;
0070 const std::string eventHeaderCollection_;
0071 const std::string eventHeaderProducer_;
0072
0073 const edm::EDGetTokenT<EcalMatacqDigiCollection> pmatToken_;
0074 const edm::EDGetTokenT<EcalRawDataCollection> dccToken_;
0075 };