49 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
50 tm_Token_ = consumes<L1MuDTChambPhContainer>(
52 seg_Token_ = consumes<DTRecSegment4DCollection>(
55 processDDU = ps.getUntrackedParameter<
bool>(
"processDDU",
false);
58 ddu_Token_ = consumes<DTLocalTriggerCollection>(
61 bxTime = ps.getParameter<
double>(
"bxTimeInterval");
62 rangeInBX = ps.getParameter<
bool>(
"rangeWithinBX");
63 nBXLow = ps.getParameter<
int>(
"nBXLow");
64 nBXHigh = ps.getParameter<
int>(
"nBXHigh");
65 angleRange = ps.getParameter<
double>(
"angleRange");
66 minHitsPhi = ps.getParameter<
int>(
"minHitsPhi");
73 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
79 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Book Histograms"<<endl;
87 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
88 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
90 for (; chambIt!=chambEnd; ++chambIt) {
110 for (
int i=0;
i<5;++
i){
111 for (
int j=0;j<6;++j){
112 for (
int k=0;
k<13;++
k){
122 vector<L1MuDTChambPhDigi>
const* phTrigs = l1DTTPGPh->
getContainer();
124 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
125 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
126 for(; iph !=iphe ; ++iph) {
128 int phwheel = iph->whNum();
129 int phsec = iph->scNum() + 1;
130 int phst = iph->stNum();
131 int phcode = iph->code();
133 if(phcode>
phCodeBestTM[phwheel+3][phst][phsec] && phcode<7) {
145 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
151 int sec =
id.sector();
152 int st =
id.station();
156 int quality = trigIt->quality();
158 if(quality>-1 && quality<7 &&
167 vector<const DTRecSegment4D*> bestSegments4D;
173 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt){
180 for ( track = range.first; track != range.second; ++track){
181 if( (*track).hasPhi() ) {
182 hits = (*track).phiSegment()->degreesOfFreedom()+2;
183 if ( hits>hitsBest ){
190 bestSegments4D.push_back(best);
196 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
197 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
198 for (; bestSegIt!=bestSegEnd; ++bestSegIt ){
200 float dir = atan((*bestSegIt)->localDirection().x()/ (*bestSegIt)->localDirection().z())*180/
Geom::pi();
210 float t0seg = (*bestSegIt)->phiSegment()->t0();
212 float time = tTrig+t0seg;
216 int sector = chambId.
sector();
218 int scsector = sector>12 ? sector==13 ? 4 : 10 : sector;
223 if (fabs(t0seg)>0.01) {
224 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
225 if ( qualTM>=0 ) innerME.find(
"TM_TrackCrossingTimeAll")->second->Fill(htime);
226 if ( qualTM==6 ) innerME.find(
"TM_TrackCrossingTimeHH")->second->Fill(htime);
227 if (
processDDU && qualDDU>=0 ) innerME.find(
"DDU_TrackCrossingTimeAll")->second->Fill(htime);
228 if (
processDDU && qualDDU==6 ) innerME.find(
"DDU_TrackCrossingTimeHH")->second->Fill(htime);
240 stringstream sector; sector << dtChId.
sector();
241 uint32_t chRawId = dtChId.
rawId();
243 ibooker.
setCurrentFolder(
baseDir() +
"/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() );
245 std::vector<string> histoTags = {
"SEG_TrackCrossingTime",
"TM_TrackCrossingTimeAll",
"TM_TrackCrossingTimeHH" };
248 histoTags.push_back(
"DDU_TrackCrossingTimeAll");
249 histoTags.push_back(
"DDU_TrackCrossingTimeHH");
256 for (
const auto & histoTag : histoTags) {
257 string histoName = histoTag + (
rangeInBX ?
"InBX" :
"") +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
258 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: booking " 259 <<
baseDir() +
"/Wheel" << wheel.str()
260 <<
"/Sector" << sector.str()
261 <<
"/Station"<< station.str()
262 <<
"/" << histoName << endl;
267 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3" };
269 for (
int iFloat=0;iFloat<2;++iFloat) {
270 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.
constexpr uint32_t rawId() const
get the raw id
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Beginrun.
std::unique_ptr< DTTTrigBaseSync > tTrigSync
edm::EDGetTokenT< DTLocalTriggerCollection > ddu_Token_
edm::ESHandle< DTGeometry > muonGeom
C::const_iterator const_iterator
constant access iterator type
void setCurrentFolder(std::string const &fullpath)
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.
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
std::vector< DigiType >::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.