Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:44

0001 #ifndef CSCAFEBTHRANALYSIS_H
0002 #define CSCAFEBTHRANALYSIS_H
0003 
0004 #include "TH1.h"
0005 #include "TH2.h"
0006 #include "TFile.h"
0007 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
0008 #include "OnlineDB/CSCCondDB/interface/CSCToAFEB.h"
0009 #include <map>
0010 #include <string>
0011 #include <sstream>
0012 #include <cstdio>
0013 
0014 /** \class CSCAFEBThrAnalysis
0015   *  
0016   * \author 
0017   */
0018 class CSCAFEBThrAnalysis {
0019 public:
0020   CSCAFEBThrAnalysis();
0021   void setup(const std::string& histoFileName);
0022   void analyze(const CSCWireDigiCollection& wirecltn);
0023   void done();
0024 
0025 private:
0026   void bookForId(int flag, const int& idint, const std::string& ids);
0027   void hf1ForId(std::map<int, TH1*>& mp, int flag, const int& id, float& x, float w);
0028   void hf2ForId(std::map<int, TH2*>& mp, int flag, const int& id, float& x, float& y, float w);
0029   /// Statistics
0030   int nmbev;
0031   int nmbev_no_wire;
0032 
0033   /// DAC info
0034   int npulses;
0035   int unsigned indDac;
0036   int BegDac;
0037   int EndDac;
0038   int EvDac;
0039   int StepDac;
0040   std::vector<float> vecDac;
0041   std::vector<int> vecDacOccup;
0042 
0043   /// Maps - per event, threshold curve, fit results
0044   std::map<int, std::vector<int> > m_wire_ev;
0045   std::map<int, std::vector<std::vector<int> > > m_wire_dac;
0046   std::map<int, std::vector<std::vector<float> > > m_res_for_db;
0047 
0048   /// Layer, wire to AFEB, channel conversion
0049   const CSCToAFEB csctoafeb;
0050 
0051   /// ROOT hist file
0052   TFile* hist_file;
0053 
0054   /// Histogram maps
0055   std::map<int, TH1*> mh_ChanEff;
0056 
0057   std::map<int, TH2*> mh_FirstTime;
0058   std::map<int, TH2*> mh_AfebDac;
0059   std::map<int, TH2*> mh_AfebThrPar;
0060   std::map<int, TH2*> mh_AfebNoisePar;
0061   std::map<int, TH2*> mh_AfebNDF;
0062   std::map<int, TH2*> mh_AfebChi2perNDF;
0063 };
0064 
0065 #endif