CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/L1Trigger/DTTrigger/interface/DTTrig.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00012 //
00013 //--------------------------------------------------
00014 #ifndef DT_TRIG_H 
00015 #define DT_TRIG_H
00016 
00017 //---------------
00018 // C++ Headers --
00019 //---------------
00020 #include<map>
00021 #include<string>
00022 
00023 //------------------------------------
00024 // Collaborating Class Declarations --
00025 //------------------------------------
00026 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00027 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00028 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00029 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00030 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
00031 #include "DataFormats/MuonDetId/interface/DTSectCollId.h"
00032 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00033 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00034 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00035 #include "DataFormats/GeometryVector/interface/LocalVector.h"
00036 #include "L1Trigger/DTSectorCollector/interface/DTSCTrigUnit.h"
00037 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
00038 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
00039 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
00040 #include "L1Trigger/DTTriggerServerPhi/interface/DTChambPhSegm.h"
00041 #include "L1Trigger/DTTriggerServerTheta/interface/DTChambThSegm.h"
00042 #include "L1Trigger/DTSectorCollector/interface/DTSectColl.h"
00043 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
00044 
00045 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00046 
00047 
00048 class InputTag;
00049 
00050 //              ---------------------
00051 //              -- Class Interface --
00052 //              ---------------------
00053  
00054 class DTTrig {
00055 
00056   public:
00057 
00058     typedef std::map< DTChamberId,DTSCTrigUnit*,std::less<DTChamberId> > TUcontainer;
00059     typedef TUcontainer::iterator TU_iterator;
00060     typedef TUcontainer::const_iterator TU_const_iterator;
00061     typedef std::map< DTSectCollId,DTSectColl*,std::less<DTSectCollId> > SCcontainer;
00062     typedef SCcontainer::iterator SC_iterator;
00063     typedef SCcontainer::const_iterator SC_const_iterator;
00064     typedef std::pair<TU_iterator,TU_iterator> Range;
00065     typedef std::pair<SC_iterator,SC_iterator> SCRange;
00066     typedef std::map< DTChamberId,DTDigiCollection,std::less<DTChamberId> > DTDigiMap;
00067     typedef DTDigiMap::iterator DTDigiMap_iterator;
00068     typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
00069 
00070   public:
00071   
00073     DTTrig(const edm::ParameterSet &params);
00074 
00076     ~DTTrig();
00077     
00079     void createTUs(const edm::EventSetup& iSetup);
00080 
00082     void updateES(const edm::EventSetup& iSetup);
00083 
00085     void triggerReco(const edm::Event& iEvent, const edm::EventSetup& iSetup);
00086       
00088     void clear();
00089 
00091     int size() { return _cache.size(); }
00092 
00094     TU_iterator begin() { /*check();*/ return _cache.begin(); }
00095 
00097     TU_iterator end() { /*check();*/ return _cache.end(); }
00098 
00100     TU_iterator find(DTChamberId id) { /*check();*/ return _cache.find(id); }
00101 
00103     Range cache() { /*check();*/ return Range(_cache.begin(), _cache.end()); }
00104  
00105     // ------------ do the same for Sector Collector
00106     
00108     int size1() { /*check();*/ return _cache1.size(); }
00109 
00111     SC_iterator begin1() { /*check();*/ return _cache1.begin(); }
00112 
00114     SC_iterator end1() { /*check();*/ return _cache1.end(); }
00115 
00117     SC_iterator find1(DTSectCollId id) { /*check();*/ return _cache1.find(id); }
00118 
00120     SCRange cache1() { /*check();*/ return SCRange(_cache1.begin(), _cache1.end()); }
00121 
00123     DTSCTrigUnit* trigUnit(DTChamberId sid);
00124 
00126     DTSCTrigUnit* trigUnit(int wheel, int stat, int sect);
00127 
00129     DTChambPhSegm* chPhiSegm1(DTChamberId sid, int step);
00130 
00132     DTChambPhSegm* chPhiSegm1(DTSCTrigUnit* unit, int step);
00133 
00135     DTChambPhSegm* chPhiSegm1(int wheel, int stat, int sect, int step); 
00136 
00138     DTChambPhSegm* chPhiSegm2(DTChamberId sid, int step);
00139 
00141     DTChambPhSegm* chPhiSegm2(DTSCTrigUnit* unit, int step);
00142 
00144     DTChambPhSegm* chPhiSegm2(int wheel, int stat, int sect, int step);
00145 
00147     DTChambThSegm* chThetaSegm(DTChamberId sid, int step);
00148 
00150     DTChambThSegm* chThetaSegm(DTSCTrigUnit* unit, int step);
00151 
00153     DTChambThSegm* chThetaSegm(int wheel, int stat, int sect, int step);
00154 
00155     // sector collector 
00156 
00158     DTSectCollPhSegm* chSectCollPhSegm1(DTSectColl* unit, int step);
00159 
00161     DTSectCollPhSegm* chSectCollPhSegm1(int wheel, int sect, int step); 
00162 
00164     DTSectCollPhSegm* chSectCollPhSegm2(DTSectColl* unit, int step);
00165   
00167     DTSectCollPhSegm* chSectCollPhSegm2(int wheel, int sect, int step);
00168 
00170     DTSectCollThSegm* chSectCollThSegm(DTSectColl* unit, int step);
00171 
00173     DTSectCollThSegm* chSectCollThSegm(int wheel, int sect, int step);
00174 
00175     // end sector collector
00176 
00178     void dumpGeom();
00179 
00181     void dumpLuts(short int lut_btic, const DTConfigManager *conf);
00182 
00184     int getBXOffset() { return _conf_manager->getBXOffset(); }
00185 
00186     // Methods to access intermediate results
00187 
00189     std::vector<DTBtiTrigData> BtiTrigs();
00190 
00192     std::vector<DTTracoTrigData> TracoTrigs();
00193 
00195     std::vector<DTChambPhSegm> TSPhTrigs();
00196 
00198     std::vector<DTChambThSegm> TSThTrigs();
00199 
00201     std::vector<DTSectCollPhSegm> SCPhTrigs();
00202 
00204     std::vector<DTSectCollThSegm> SCThTrigs();
00205 
00207     LocalPoint localPosition(const DTTrigData* trig) const {
00208       return constTrigUnit(trig->ChamberId())->localPosition(trig);
00209     }
00210 
00212     GlobalPoint CMSPosition(const DTTrigData* trig) const {
00213       return constTrigUnit(trig->ChamberId())->CMSPosition(trig);
00214     }
00215 
00217     LocalVector localDirection(const DTTrigData* trig) const {
00218       return constTrigUnit(trig->ChamberId())->localDirection(trig);
00219     }
00220 
00222     GlobalVector CMSDirection(const DTTrigData* trig) const {
00223       return constTrigUnit(trig->ChamberId())->CMSDirection(trig);
00224     }
00225 
00227     void print(DTTrigData* trig) const {
00228       constTrigUnit(trig->ChamberId())->print(trig);
00229     }
00230 
00231   private:
00232 
00233     // const version of the methods to access TUs and SCs are private to avoid misuse
00235     DTSCTrigUnit* constTrigUnit(DTChamberId sid) const;
00236 
00238     DTSCTrigUnit* constTrigUnit(int wheel, int stat, int sect) const;
00239 
00241     DTSectColl* SCUnit(DTSectCollId scid) const;
00242 
00244     DTSectColl* SCUnit(int wheel, int sect) const;
00245  
00246   private:
00247 
00248     TUcontainer _cache;                 // Trigger units
00249     SCcontainer _cache1;                // Sector Collector units
00250     const DTConfigManager *_conf_manager;    // Configuration Manager class pointer 
00251     edm::InputTag _digitag;
00252     bool _debug;                        // Debug flag
00253     bool _inputexist;
00254 
00255     unsigned long long _configid;
00256     unsigned long long _geomid;
00257 
00258 };
00259 
00260 #endif