45 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
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");
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) {
128 for (track = range.first; track != range.second; ++track) {
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();
156 float time = tTrig + t0seg;
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);
179 wheel << dtChId.
wheel();
183 sector << dtChId.
sector();
184 uint32_t chRawId = dtChId.
rawId();
186 ibooker.
setCurrentFolder(
baseDir() +
"/Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str());
188 std::vector<string> histoTags = {
"SEG_TrackCrossingTime",
"TM_TrackCrossingTimeAll",
"TM_TrackCrossingTimeHH"};
194 for (
const auto&
histoTag : histoTags) {
196 histoTag + (
rangeInBX ?
"InBX" :
"") +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
198 <<
"[DTLocalTriggerSynchTask]: booking " <<
baseDir() +
"/Wheel" << wheel.str() <<
"/Sector" << sector.str()
199 <<
"/Station" << station.str() <<
"/" << histoName << endl;
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();
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
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
MonitorElement * bookFloat(TString const &name)
std::string baseDirectory
void analyze(const edm::Event &event, const edm::EventSetup &context) override
Analyze.
void setCurrentFolder(std::string const &fullpath)
constexpr uint32_t rawId() const
get the raw id
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Beginrun.
std::unique_ptr< DTTTrigBaseSync > tTrigSync
constexpr int32_t ceil(float num)
edm::ESHandle< DTGeometry > muonGeom
C::const_iterator const_iterator
constant access iterator type
int degreesOfFreedom() const override
return the DOF of the segment
DTLocalTriggerSynchTask(const edm::ParameterSet &ps)
Constructor.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Book the histograms.
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
Phi_Container const * getContainer() const
std::map< uint32_t, std::map< std::string, MonitorElement * > > triggerHistos
void bookHistos(DQMStore::IBooker &, const DTChamberId &dtCh)
Book the histograms.
int station() const
Return the station number.
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
int wheel() const
Return the wheel number.
~DTLocalTriggerSynchTask() override
Destructor.