45 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
47 tm_Token_ = consumes<L1MuDTChambPhContainer>(
49 ddu_Token_ = consumes<DTLocalTriggerCollection>(
51 seg_Token_ = consumes<DTRecSegment4DCollection>(
66 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
72 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Book Histograms"<<endl;
82 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
83 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
85 for (; chambIt!=chambEnd; ++chambIt) {
109 for (
int i=0;
i<5;++
i){
110 for (
int j=0;j<6;++j){
111 for (
int k=0;
k<13;++
k){
121 vector<L1MuDTChambPhDigi>
const* phTrigs = l1DTTPGPh->
getContainer();
123 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
124 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
125 for(; iph !=iphe ; ++iph) {
127 int phwheel = iph->whNum();
128 int phsec = iph->scNum() + 1;
129 int phst = iph->stNum();
130 int phcode = iph->code();
132 if(phcode>
phCodeBestTM[phwheel+3][phst][phsec] && phcode<7) {
143 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
149 int sec =
id.sector();
150 int st =
id.station();
154 int quality = trigIt->quality();
156 if(quality>-1 && quality<7 &&
164 vector<const DTRecSegment4D*> bestSegments4D;
168 DTRecSegment4DCollection::id_iterator chambIdIt;
170 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt){
177 for ( track = range.first; track != range.second; ++track){
178 if( (*track).hasPhi() ) {
179 hits = (*track).phiSegment()->degreesOfFreedom()+2;
180 if ( hits>hitsBest ){
187 bestSegments4D.push_back(best);
193 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
194 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
195 for (; bestSegIt!=bestSegEnd; ++bestSegIt ){
197 float dir = atan((*bestSegIt)->localDirection().x()/ (*bestSegIt)->localDirection().z())*180/
Geom::pi();
207 float t0seg = (*bestSegIt)->phiSegment()->t0();
209 float time = tTrig+t0seg;
213 int sector = chambId.
sector();
215 int scsector = sector>12 ? sector==13 ? 4 : 10 : sector;
220 if (fabs(t0seg)>0.01) {
221 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
222 if ( qualTM>=0 ) innerME.find(
"TM_TrackCrossingTimeAll")->second->Fill(htime);
223 if ( qualTM==6 ) innerME.find(
"TM_TrackCrossingTimeHH")->second->Fill(htime);
224 if ( qualDDU>=0 ) innerME.find(
"DDU_TrackCrossingTimeAll")->second->Fill(htime);
225 if ( qualDDU==6 ) innerME.find(
"DDU_TrackCrossingTimeHH")->second->Fill(htime);
237 stringstream sector; sector << dtChId.
sector();
238 uint32_t chRawId = dtChId.
rawId();
240 ibooker.
setCurrentFolder(
baseDir() +
"/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() );
243 string histoTag[5] = {
"SEG_TrackCrossingTime",
"TM_TrackCrossingTimeAll",
"TM_TrackCrossingTimeHH",
"DDU_TrackCrossingTimeAll",
"DDU_TrackCrossingTimeHH" };
249 for (
int iHisto=0;iHisto<5;++iHisto) {
250 string histoName = histoTag[iHisto] + (
rangeInBX ?
"InBX" :
"") +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
251 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: booking " 252 <<
baseDir() +
"/Wheel" << wheel.str()
253 <<
"/Sector" << sector.str()
254 <<
"/Station"<< station.str()
255 <<
"/" << histoName << endl;
260 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3" };
262 for (
int iFloat=0;iFloat<2;++iFloat) {
263 string floatName = floatTag[iFloat] +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
T getParameter(std::string const &) const
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
std::pair< const_iterator, const_iterator > range
iterator range
std::string baseDirectory
void analyze(const edm::Event &event, const edm::EventSetup &context) override
Analyze.
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globalPos)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Beginrun.
edm::EDGetTokenT< DTLocalTriggerCollection > ddu_Token_
edm::ESHandle< DTGeometry > muonGeom
uint32_t rawId() const
get the raw id
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the synchronization module at each event.
int degreesOfFreedom() const override
return the DOF of the segment
DTLocalTriggerSynchTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * book1D(Args &&...args)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Book the histograms.
DTTTrigBaseSync * tTrigSync
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
edm::ParameterSet parameters
void setCurrentFolder(const std::string &fullpath)
std::vector< DTLocalTrigger >::const_iterator const_iterator
Phi_Container const * getContainer() const
std::map< uint32_t, std::map< std::string, MonitorElement * > > triggerHistos
std::pair< const_iterator, const_iterator > Range
void bookHistos(DQMStore::IBooker &, const DTChamberId &dtCh)
Book the histograms.
MonitorElement * bookFloat(Args &&...args)
int station() const
Return the station number.
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
int wheel() const
Return the wheel number.
const int wheelArrayShift
T get(const Candidate &c)
~DTLocalTriggerSynchTask() override
Destructor.