CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.h

Go to the documentation of this file.
00001 #ifndef DTVDriftCalibration_H
00002 #define DTVDriftCalibration_H
00003 
00013 #include "FWCore/Framework/interface/EDAnalyzer.h"
00014 #include "FWCore/Utilities/interface/InputTag.h"
00015 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00016 
00017 #include "CalibMuon/DTCalibration/interface/vDriftHistos.h"
00018 #include "CalibMuon/DTCalibration/interface/DTTMax.h"
00019 #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h"
00020 
00021 #include "DTCalibrationMap.h"
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 namespace edm {
00027   class ParameterSet;
00028   class Event;
00029   class EventSetup;
00030 }
00031 
00032 class TFile;
00033 class DTMeanTimerFitter;
00034 
00035 class DTVDriftCalibration : public edm::EDAnalyzer {
00036 public:
00038   DTVDriftCalibration(const edm::ParameterSet& pset);
00039 
00041   virtual ~DTVDriftCalibration();
00042 
00043   // Operations
00044 
00045   void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00046 
00047   void endJob();
00048   
00049 protected:
00050 
00051 private:
00052 
00053   DTSegmentSelector select_;
00054 
00055   // The class containing TMax information
00056   typedef DTTMax::TMax TMax;
00057  
00058   // class to create/manage histos for each partition (SL) 
00059   class cellInfo{
00060   public:
00061     cellInfo(TString name) {
00062       histos = new hTMaxCell(name);
00063     }  
00064    
00065     ~cellInfo() {
00066       delete histos;
00067     }
00068 
00069     void add(std::vector<const TMax*> tMaxes);
00070     void update() {addedCells.clear();}
00071     hTMaxCell* getHists() {return histos;}
00072     
00073   private: 
00074     cellInfo(){};
00075     cellInfo(const cellInfo&){};
00076     
00077     std::vector<dttmaxenums::TMaxCells> addedCells;
00078     hTMaxCell* histos;
00079   };
00080 
00081   h2DSegm *h2DSegmRZ;
00082   h2DSegm *h2DSegmRPhi;
00083   h4DSegm *h4DSegmAllCh;
00084 
00085   // Divide cellInfo by given granularity (to be implemented)
00086   // DTVDriftCalibration::cellInfo* partition(const DTWireId& wireId); 
00087 
00088   // Specify the granularity for the TMax histograms
00089   enum TMaxGranularity {byChamber, bySL, byPartition};
00090   TMaxGranularity theGranularity;
00091  
00092   // The label used to retrieve 4D segments from the event
00093   edm::InputTag theRecHits4DLabel;
00094 
00095   // Debug flag
00096   bool debug;
00097   
00098   // The label used to retrieve digis from the event
00099   std::string digiLabel;
00100   
00101   // The file which will contain the tMax histograms
00102   TFile *theFile;
00103 
00104   // The fitter
00105   DTMeanTimerFitter *theFitter;
00106 
00107   // Perform the vDrift and t0 evaluation or just fill the
00108   //  tMaxHists (if you read the dataset in different jobs)
00109   bool findVDriftAndT0;
00110 
00111   // The name of the output text file
00112   std::string theVDriftOutputFile;
00113 
00114   // Map of wires and cellInfo with coarse granularity
00115   std::map<DTWireId, cellInfo*> theWireIdAndCellMap;
00116 
00117   // Switch for checking of noisy channels
00118   //bool checkNoisyChannels;
00119 
00120   // The module for t0 subtraction
00121   DTTTrigBaseSync *theSync;//FIXME: should be const
00122 
00123   // parameter set for DTCalibrationMap constructor
00124   edm::ParameterSet theCalibFilePar;
00125 
00126   // Maximum value for the 4D Segment chi2
00127   //double theMaxChi2;
00128 
00129   // Maximum incident angle for Phi Seg 
00130   //double theMaxPhiAngle;
00131 
00132   // Maximum incident angle for Theta Seg
00133   //double theMaxZAngle;
00134 
00135   // Choose the chamber you want to calibrate
00136   std::string theCalibChamber;
00137 
00138 };
00139 #endif
00140