46 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
50 ddu_Token_ = consumes<DTLocalTriggerCollection>(
52 seg_Token_ = consumes<DTRecSegment4DCollection>(
59 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
66 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: BeginJob" << endl;
77 dbe->setCurrentFolder(
baseDir());
78 dbe->bookFloat(
"BXTimeSpacing")->Fill(
bxTime);
84 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Begin Run"<<endl;
92 std::vector<DTChamber*>::const_iterator chambIt =
muonGeom->chambers().begin();
93 std::vector<DTChamber*>::const_iterator chambEnd =
muonGeom->chambers().end();
95 for (; chambIt!=chambEnd; ++chambIt) {
106 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
120 for (
int i=0;
i<5;++
i){
121 for (
int j=0;
j<6;++
j){
122 for (
int k=0;
k<13;++
k){
132 vector<L1MuDTChambPhDigi>
const* phTrigs = l1DTTPGPh->getContainer();
134 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
135 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
136 for(; iph !=iphe ; ++iph) {
138 int phwheel = iph->whNum();
139 int phsec = iph->scNum() + 1;
140 int phst = iph->stNum();
141 int phcode = iph->code();
143 if(phcode>
phCodeBestDCC[phwheel+3][phst][phsec] && phcode<7) {
154 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
160 int sec =
id.sector();
161 int st =
id.station();
165 int quality = trigIt->quality();
167 if(quality>-1 && quality<7 &&
175 vector<const DTRecSegment4D*> bestSegments4D;
179 DTRecSegment4DCollection::id_iterator chambIdIt;
181 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt){
188 for ( track = range.first; track != range.second; ++track){
189 if( (*track).hasPhi() ) {
191 if ( hits>hitsBest ){
198 bestSegments4D.push_back(best);
204 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
205 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
206 for (; bestSegIt!=bestSegEnd; ++bestSegIt ){
208 float dir = atan((*bestSegIt)->localDirection().x()/ (*bestSegIt)->localDirection().z())*180/
Geom::pi();
218 float t0seg = (*bestSegIt)->phiSegment()->t0();
220 float time = tTrig+t0seg;
223 int wheel = chambId.
wheel();
224 int sector = chambId.
sector();
226 int scsector = sector>12 ? sector==13 ? 4 : 10 : sector;
231 if (fabs(t0seg)>0.01) {
232 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
233 if ( qualDCC>=0 ) innerME.find(
"DCC_TrackCrossingTimeAll")->second->Fill(htime);
234 if ( qualDCC==6 ) innerME.find(
"DCC_TrackCrossingTimeHH")->second->Fill(htime);
235 if ( qualDDU>=0 ) innerME.find(
"DDU_TrackCrossingTimeAll")->second->Fill(htime);
236 if ( qualDDU==6 ) innerME.find(
"DDU_TrackCrossingTimeHH")->second->Fill(htime);
246 stringstream wheel; wheel << dtChId.
wheel();
248 stringstream sector; sector << dtChId.
sector();
249 uint32_t chRawId = dtChId.
rawId();
254 string histoTag[5] = {
"SEG_TrackCrossingTime",
"DCC_TrackCrossingTimeAll",
"DCC_TrackCrossingTimeHH",
"DDU_TrackCrossingTimeAll",
"DDU_TrackCrossingTimeHH" };
260 for (
int iHisto=0;iHisto<5;++iHisto) {
261 string histoName = histoTag[iHisto] + (
rangeInBX ?
"InBX" :
"") +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
262 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: booking "
263 <<
baseDir() +
"/Wheel" << wheel.str()
264 <<
"/Sector" << sector.str()
265 <<
"/Station"<< station.str()
266 <<
"/" << histoName << endl;
271 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3" };
273 for (
int iFloat=0;iFloat<2;++iFloat) {
274 string floatName = floatTag[iFloat] +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
T getParameter(std::string const &) const
std::pair< const_iterator, const_iterator > range
iterator range
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual int degreesOfFreedom() const
return the DOF of the segment
void rmdir(const std::string &fullpath)
std::string baseDirectory
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globalPos)
int phCodeBestDCC[6][5][13]
edm::EDGetTokenT< DTLocalTriggerCollection > ddu_Token_
MonitorElement * bookFloat(const char *name)
Book float.
void beginRun(const edm::Run &run, const edm::EventSetup &context)
Begin Run.
edm::ESHandle< DTGeometry > muonGeom
uint32_t rawId() const
get the raw id
int phCodeBestDDU[6][5][13]
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the synchronization module at each event.
void analyze(const edm::Event &event, const edm::EventSetup &context)
Analyze.
virtual ~DTLocalTriggerSynchTask()
Destructor.
const T & max(const T &a, const T &b)
DTLocalTriggerSynchTask(const edm::ParameterSet &ps)
Constructor.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
DTTTrigBaseSync * tTrigSync
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
edm::ParameterSet parameters
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_Token_
std::vector< DTLocalTrigger >::const_iterator const_iterator
std::map< uint32_t, std::map< std::string, MonitorElement * > > triggerHistos
std::pair< const_iterator, const_iterator > Range
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void setCurrentFolder(const std::string &fullpath)
T get(const Candidate &c)
void bookHistos(const DTChamberId &dtCh)
Book the histograms.