52 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
60 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
67 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: BeginJob" << endl;
78 dbe->setCurrentFolder(
baseDir());
79 dbe->bookFloat(
"BXTimeSpacing")->Fill(
bxTime);
85 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Begin Run"<<endl;
93 std::vector<DTChamber*>::const_iterator chambIt =
muonGeom->chambers().begin();
94 std::vector<DTChamber*>::const_iterator chambEnd =
muonGeom->chambers().end();
96 for (; chambIt!=chambEnd; ++chambIt) {
107 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
121 for (
int i=0;
i<5;++
i){
122 for (
int j=0;
j<6;++
j){
123 for (
int k=0;
k<13;++
k){
132 event.getByLabel(inputTagDCC,l1DTTPGPh);
133 vector<L1MuDTChambPhDigi>* phTrigs = l1DTTPGPh->getContainer();
135 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
136 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
137 for(; iph !=iphe ; ++iph) {
139 int phwheel = iph->whNum();
140 int phsec = iph->scNum() + 1;
141 int phst = iph->stNum();
142 int phcode = iph->code();
144 if(phcode>
phCodeBestDCC[phwheel+3][phst][phsec] && phcode<7) {
152 event.getByLabel(inputTagDDU,trigsDDU);
155 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
161 int sec =
id.sector();
162 int st =
id.station();
166 int quality = trigIt->quality();
168 if(quality>-1 && quality<7 &&
176 vector<const DTRecSegment4D*> bestSegments4D;
178 event.getByLabel(inputTagSEG, segments4D);
182 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt){
189 for ( track = range.first; track != range.second; ++track){
190 if( (*track).hasPhi() ) {
192 if ( hits>hitsBest ){
199 bestSegments4D.push_back(best);
205 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
206 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
207 for (; bestSegIt!=bestSegEnd; ++bestSegIt ){
209 float dir = atan((*bestSegIt)->localDirection().x()/ (*bestSegIt)->localDirection().z())*180/
Geom::pi();
219 float t0seg = (*bestSegIt)->phiSegment()->t0();
221 float time = tTrig+t0seg;
224 int wheel = chambId.
wheel();
225 int sector = chambId.
sector();
227 int scsector = sector>12 ? sector==13 ? 4 : 10 : sector;
232 if (fabs(t0seg)>0.01) {
233 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
234 if ( qualDCC>=0 ) innerME.find(
"DCC_TrackCrossingTimeAll")->second->Fill(htime);
235 if ( qualDCC==6 ) innerME.find(
"DCC_TrackCrossingTimeHH")->second->Fill(htime);
236 if ( qualDDU>=0 ) innerME.find(
"DDU_TrackCrossingTimeAll")->second->Fill(htime);
237 if ( qualDDU==6 ) innerME.find(
"DDU_TrackCrossingTimeHH")->second->Fill(htime);
247 stringstream wheel; wheel << dtChId.
wheel();
249 stringstream sector; sector << dtChId.
sector();
250 uint32_t chRawId = dtChId.
rawId();
255 string histoTag[5] = {
"SEG_TrackCrossingTime",
"DCC_TrackCrossingTimeAll",
"DCC_TrackCrossingTimeHH",
"DDU_TrackCrossingTimeAll",
"DDU_TrackCrossingTimeHH" };
261 for (
int iHisto=0;iHisto<5;++iHisto) {
262 string histoName = histoTag[iHisto] + (
rangeInBX ?
"InBX" :
"") +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
263 edm::LogVerbatim (
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: booking "
264 <<
baseDir() +
"/Wheel" << wheel.str()
265 <<
"/Sector" << sector.str()
266 <<
"/Station"<< station.str()
267 <<
"/" << histoName << endl;
272 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3" };
274 for (
int iFloat=0;iFloat<2;++iFloat) {
275 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]
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]
C::const_iterator const_iterator
constant access iterator type
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::ParameterSet parameters
std::vector< DigiType >::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.