Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:01

0001 #ifndef CSCObjects_CSCGainsStudy_h
0002 #define CSCObjects_CSCGainsStudy_h
0003 
0004 /** \class CSCGainsStudy
0005  * 
0006  * Reads in CSC database and computes average strip gain "G" for whole CSC system.
0007  * For each strip i, it computes a factor G/g_i, where g_i is the gain for strip i.
0008  * The correction factors are then plotted for each chamber.
0009  *
0010  * \author Dominique Fortin - UCR
0011  *
0012  */
0013 
0014 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0015 #include "DataFormats/Common/interface/Handle.h"
0016 
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 
0019 #include "CondFormats/CSCObjects/interface/CSCGains.h"
0020 #include "CondFormats/DataRecord/interface/CSCGainsRcd.h"
0021 
0022 #include <CondFormats/CSCObjects/interface/CSCReadoutMappingFromFile.h>
0023 #include <CondFormats/CSCObjects/interface/CSCReadoutMappingForSliceTest.h>
0024 
0025 #include "CSCGainsStudyHistograms.h"
0026 
0027 #include <vector>
0028 #include <map>
0029 #include <string>
0030 
0031 namespace edm {
0032   class ParameterSet;
0033   class Event;
0034   class EventSetup;
0035 }  // namespace edm
0036 
0037 class TFile;
0038 
0039 class CSCGainsStudy : public edm::one::EDAnalyzer<> {
0040 public:
0041   /// configurable parameters
0042   explicit CSCGainsStudy(const edm::ParameterSet& p);
0043 
0044   ~CSCGainsStudy();
0045 
0046   // Operations
0047 
0048   /// Perform the real analysis
0049   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup);
0050 
0051   /// Compute average Gain for all CSC chambers
0052   float getStripGainAvg();
0053 
0054 private:
0055   // Pointers to histograms
0056   HCSCGains* All_CSC;
0057   // ME+1/1
0058   HCSCGains* ME_11_27;
0059   HCSCGains* ME_11_28;
0060   HCSCGains* ME_11_29;
0061   HCSCGains* ME_11_30;
0062   HCSCGains* ME_11_31;
0063   HCSCGains* ME_11_32;
0064   // ME+1/2
0065   HCSCGains* ME_12_27;
0066   HCSCGains* ME_12_28;
0067   HCSCGains* ME_12_29;
0068   HCSCGains* ME_12_30;
0069   HCSCGains* ME_12_31;
0070   HCSCGains* ME_12_32;
0071   // ME+1/3
0072   HCSCGains* ME_13_27;
0073   HCSCGains* ME_13_28;
0074   HCSCGains* ME_13_29;
0075   HCSCGains* ME_13_30;
0076   HCSCGains* ME_13_31;
0077   HCSCGains* ME_13_32;
0078   // ME+2/1
0079   HCSCGains* ME_21_14;
0080   HCSCGains* ME_21_15;
0081   HCSCGains* ME_21_16;
0082   // ME+2/2
0083   HCSCGains* ME_22_27;
0084   HCSCGains* ME_22_28;
0085   HCSCGains* ME_22_29;
0086   HCSCGains* ME_22_30;
0087   HCSCGains* ME_22_31;
0088   HCSCGains* ME_22_32;
0089   // ME+3/1
0090   HCSCGains* ME_31_14;
0091   HCSCGains* ME_31_15;
0092   HCSCGains* ME_31_16;
0093   // ME+3/2
0094   HCSCGains* ME_32_27;
0095   HCSCGains* ME_32_28;
0096   HCSCGains* ME_32_29;
0097   HCSCGains* ME_32_30;
0098   HCSCGains* ME_32_31;
0099   HCSCGains* ME_32_32;
0100 
0101   // Mapping file stuff
0102   std::string CSCMapFile;
0103   CSCReadoutMappingFromFile theCSCMap;
0104 
0105   // The file which will store the histos
0106   TFile* theFile;
0107 
0108   // Switch for debug output
0109   bool debug;
0110 
0111   // Root file name
0112   std::string rootFileName;
0113 
0114   // Store in memory the Gains
0115   const edm::ESGetToken<CSCGains, CSCGainsRcd> gainsToken;
0116   const CSCGains* pGains;
0117 };
0118 
0119 #endif