Go to the documentation of this file.00001
00002
00003
00004
00005
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef RPCTECHNICALTRIGGER_H
00026 #define RPCTECHNICALTRIGGER_H 1
00027
00028
00029 #include <memory>
00030 #include <bitset>
00031
00032
00033
00034 #include "FWCore/Framework/interface/Frameworkfwd.h"
00035 #include "FWCore/Framework/interface/EDProducer.h"
00036 #include "FWCore/Framework/interface/Event.h"
00037 #include "FWCore/Framework/interface/MakerMacros.h"
00038 #include "FWCore/Framework/interface/ESHandle.h"
00039 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00040 #include "FWCore/ServiceRegistry/interface/Service.h"
00041
00042 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
00043 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
00044 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00045 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
00046
00047 #include "DataFormats/RPCDigi/interface/RPCDigi.h"
00048 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
00049 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00050
00051
00052 #include "L1Trigger/RPCTechnicalTrigger/interface/ProcessInputSignal.h"
00053 #include "L1Trigger/RPCTechnicalTrigger/interface/TTUEmulator.h"
00054 #include "L1Trigger/RPCTechnicalTrigger/interface/TTUConfigurator.h"
00055
00056 #include "CondFormats/RPCObjects/interface/RBCBoardSpecs.h"
00057 #include "CondFormats/DataRecord/interface/RBCBoardSpecsRcd.h"
00058 #include "CondFormats/RPCObjects/interface/TTUBoardSpecs.h"
00059 #include "CondFormats/DataRecord/interface/TTUBoardSpecsRcd.h"
00060
00061
00062 #include "DataFormats/L1GlobalTrigger/interface/L1GtTechnicalTrigger.h"
00063 #include "DataFormats/L1GlobalTrigger/interface/L1GtTechnicalTriggerRecord.h"
00064
00065
00066
00067
00068 class RPCTechnicalTrigger : public edm::EDProducer {
00069 public:
00070
00071 explicit RPCTechnicalTrigger(const edm::ParameterSet&);
00072 ~RPCTechnicalTrigger();
00073
00074 private:
00075
00076
00077 virtual void beginRun(edm::Run&, const edm::EventSetup&);
00078 virtual void produce(edm::Event&, const edm::EventSetup&);
00079 virtual void endJob();
00080
00081
00082
00083 void printinfo();
00084
00085 bool Reset();
00086
00087 TTUEmulator * m_ttu[3];
00088
00089 TTUEmulator * m_ttuRbcLine[3];
00090
00091 RPCInputSignal * m_input;
00092
00093 ProcessInputSignal * m_signal;
00094
00095 std::bitset<5> m_triggerbits;
00096
00097 edm::ESHandle<RPCGeometry> m_rpcGeometry;
00098
00099 int m_verbosity;
00100 int m_useEventSetup;
00101 std::string m_configFile;
00102 std::vector<unsigned> m_ttBits;
00103 std::vector<std::string> m_ttNames;
00104 edm::InputTag m_rpcDigiLabel;
00105 edm::InputTag m_rpcSimLinkInstance;
00106
00107 int m_useRPCSimLink;
00108
00109 TTUConfigurator * m_readConfig;
00110 const TTUBoardSpecs * m_ttuspecs;
00111 const RBCBoardSpecs * m_rbcspecs;
00112
00113 int m_ievt;
00114 int m_cand;
00115 int m_boardIndex[3];
00116 int m_nWheels[3];
00117 int m_maxTtuBoards;
00118 int m_maxBits;
00119 bool m_hasConfig;
00120
00121 class TTUResults {
00122 public:
00123 TTUResults() {;}
00124
00125 TTUResults( int idx, int bx, int wh1, int wh2 ):
00126 m_ttuidx(idx),
00127 m_bx(bx),
00128 m_trigWheel1(wh1),
00129 m_trigWheel2(wh2) {;}
00130
00131 TTUResults( int idx, int bx, int wh1, int wh2 , int wdg ):
00132 m_ttuidx(idx),
00133 m_bx(bx),
00134 m_trigWheel1(wh1),
00135 m_trigWheel2(wh2),
00136 m_wedge(wdg) {;}
00137
00138 ~TTUResults()
00139 {
00140 m_ttuidx=0;
00141 m_bx=0;
00142 m_trigWheel1=0;
00143 m_trigWheel2=0;
00144 m_wedge=0;
00145 }
00146
00147 int m_ttuidx;
00148 int m_bx;
00149 int m_trigWheel1;
00150 int m_trigWheel2;
00151 int m_wedge;
00152
00153 int getTriggerForWheel( int wheel )
00154 {
00155 if( abs(wheel) > 1 ) return m_trigWheel2;
00156 else return m_trigWheel1;
00157 }
00158
00159
00160 };
00161
00162 struct sortByBx {
00163 bool operator()( const TTUResults * a, const TTUResults * b )
00164 {
00165 return (*a).m_bx < (*b).m_bx;
00166 }
00167 };
00168
00169 std::vector<TTUResults*> m_serializedInfoLine1;
00170 std::vector<TTUResults*> m_serializedInfoLine2;
00171
00172 int convertToMap( const std::vector<TTUResults*> & );
00173
00174 bool searchCoincidence( int , int );
00175
00176 std::map<int,int> m_WheelTtu;
00177
00178 std::map<int,TTUResults*> m_ttuResultsByQuadrant;
00179
00180 std::vector<int> m_quadrants;
00181
00182 std::vector<int>::iterator m_firstSector;
00183
00184
00185 };
00186
00187 #endif // RPCTECHNICALTRIGGER_H