44 muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
45 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
46 tm_Token_ = consumes<L1MuDTChambPhContainer>(ps.getParameter<
edm::InputTag>(
"TMInputTag"));
47 seg_Token_ = consumes<DTRecSegment4DCollection>(ps.getParameter<
edm::InputTag>(
"SEGInputTag"));
49 bxTime = ps.getParameter<
double>(
"bxTimeInterval");
50 rangeInBX = ps.getParameter<
bool>(
"rangeWithinBX");
51 nBXLow = ps.getParameter<
int>(
"nBXLow");
52 nBXHigh = ps.getParameter<
int>(
"nBXHigh");
53 angleRange = ps.getParameter<
double>(
"angleRange");
54 minHitsPhi = ps.getParameter<
int>(
"minHitsPhi");
55 baseDirectory = ps.getParameter<
string>(
"baseDir");
59 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
65 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Book Histograms" << endl;
72 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
73 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
75 for (; chambIt != chambEnd; ++chambIt) {
89 for (
int i = 0;
i < 5; ++
i) {
90 for (
int j = 0;
j < 6; ++
j) {
91 for (
int k = 0;
k < 13; ++
k) {
100 vector<L1MuDTChambPhDigi>
const* phTrigs = l1DTTPGPh->
getContainer();
102 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
103 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
104 for (; iph != iphe; ++iph) {
105 int phwheel = iph->whNum();
106 int phsec = iph->scNum() + 1;
107 int phst = iph->stNum();
108 int phcode = iph->code();
110 if (phcode >
phCodeBestTM[phwheel + 3][phst][phsec] && phcode < 7) {
116 vector<const DTRecSegment4D*> bestSegments4D;
122 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt) {
129 if ((*track).hasPhi()) {
130 hits = (*track).phiSegment()->degreesOfFreedom() + 2;
131 if (
hits > hitsBest) {
138 bestSegments4D.push_back(best);
143 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
144 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
145 for (; bestSegIt != bestSegEnd; ++bestSegIt) {
146 float dir = atan((*bestSegIt)->localDirection().x() / (*bestSegIt)->localDirection().z()) * 180 /
154 float t0seg = (*bestSegIt)->phiSegment()->t0();
160 int sector = chambId.
sector();
162 int scsector = sector > 12 ? sector == 13 ? 4 : 10 : sector;
166 if (fabs(t0seg) > 0.01) {
167 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
169 innerME.find(
"TM_TrackCrossingTimeAll")->second->Fill(htime);
171 innerME.find(
"TM_TrackCrossingTimeHH")->second->Fill(htime);
183 sector << dtChId.
sector();
184 uint32_t chRawId = dtChId.
rawId();
188 std::vector<string> histoTags = {
"SEG_TrackCrossingTime",
"TM_TrackCrossingTimeAll",
"TM_TrackCrossingTimeHH"};
194 for (
const auto&
histoTag : histoTags) {
198 <<
"[DTLocalTriggerSynchTask]: booking " <<
baseDir() +
"/Wheel" <<
wheel.str() <<
"/Sector" << sector.str()
204 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3"};
206 for (
int iFloat = 0; iFloat < 2; ++iFloat) {
207 string floatName = floatTag[iFloat] +
"_W" +
wheel.str() +
"_Sec" + sector.str() +
"_St" +
station.str();