45 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
47 tm_Token_ = consumes<L1MuDTChambPhContainer>(
49 seg_Token_ = consumes<DTRecSegment4DCollection>(
55 ddu_Token_ = consumes<DTLocalTriggerCollection>(
70 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
76 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Book Histograms"<<endl;
86 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
87 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
89 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) {
144 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
150 int sec =
id.sector();
151 int st =
id.station();
155 int quality = trigIt->quality();
157 if(quality>-1 && quality<7 &&
166 vector<const DTRecSegment4D*> bestSegments4D;
170 DTRecSegment4DCollection::id_iterator chambIdIt;
172 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt){
179 for ( track = range.first; track != range.second; ++track){
180 if( (*track).hasPhi() ) {
181 hits = (*track).phiSegment()->degreesOfFreedom()+2;
182 if ( hits>hitsBest ){
189 bestSegments4D.push_back(best);
195 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
196 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
197 for (; bestSegIt!=bestSegEnd; ++bestSegIt ){
199 float dir = atan((*bestSegIt)->localDirection().x()/ (*bestSegIt)->localDirection().z())*180/
Geom::pi();
209 float t0seg = (*bestSegIt)->phiSegment()->t0();
211 float time = tTrig+t0seg;
215 int sector = chambId.
sector();
217 int scsector = sector>12 ? sector==13 ? 4 : 10 : sector;
222 if (fabs(t0seg)>0.01) {
223 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
224 if ( qualTM>=0 ) innerME.find(
"TM_TrackCrossingTimeAll")->second->Fill(htime);
225 if ( qualTM==6 ) innerME.find(
"TM_TrackCrossingTimeHH")->second->Fill(htime);
226 if (
processDDU && qualDDU>=0 ) innerME.find(
"DDU_TrackCrossingTimeAll")->second->Fill(htime);
227 if (
processDDU && qualDDU==6 ) innerME.find(
"DDU_TrackCrossingTimeHH")->second->Fill(htime);
239 stringstream sector; sector << dtChId.
sector();
240 uint32_t chRawId = dtChId.
rawId();
242 ibooker.
setCurrentFolder(
baseDir() +
"/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() );
244 std::vector<string> histoTags = {
"SEG_TrackCrossingTime",
"TM_TrackCrossingTimeAll",
"TM_TrackCrossingTimeHH" };
247 histoTags.push_back(
"DDU_TrackCrossingTimeAll");
248 histoTags.push_back(
"DDU_TrackCrossingTimeHH");
255 for (
const auto & histoTag : histoTags) {
256 string histoName = histoTag + (
rangeInBX ?
"InBX" :
"") +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
257 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: booking " 258 <<
baseDir() +
"/Wheel" << wheel.str()
259 <<
"/Sector" << sector.str()
260 <<
"/Station"<< station.str()
261 <<
"/" << histoName << endl;
266 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3" };
268 for (
int iFloat=0;iFloat<2;++iFloat) {
269 string floatName = floatTag[iFloat] +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
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)
constexpr uint32_t rawId() const
get the raw id
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Beginrun.
edm::EDGetTokenT< DTLocalTriggerCollection > ddu_Token_
edm::ESHandle< DTGeometry > muonGeom
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_
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.