45 consumesCollector())},
46 muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
47 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Constructor" << endl;
48 tm_Token_ = consumes<L1MuDTChambPhContainer>(ps.getParameter<
edm::InputTag>(
"TMInputTag"));
49 seg_Token_ = consumes<DTRecSegment4DCollection>(ps.getParameter<
edm::InputTag>(
"SEGInputTag"));
51 bxTime = ps.getParameter<
double>(
"bxTimeInterval");
52 rangeInBX = ps.getParameter<
bool>(
"rangeWithinBX");
53 nBXLow = ps.getParameter<
int>(
"nBXLow");
54 nBXHigh = ps.getParameter<
int>(
"nBXHigh");
55 angleRange = ps.getParameter<
double>(
"angleRange");
56 minHitsPhi = ps.getParameter<
int>(
"minHitsPhi");
57 baseDirectory = ps.getParameter<
string>(
"baseDir");
61 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: analyzed " <<
nevents <<
" events" << endl;
67 edm::LogVerbatim(
"DTLocalTriggerSynchTask") <<
"[DTLocalTriggerSynchTask]: Book Histograms" << endl;
74 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
75 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
77 for (; chambIt != chambEnd; ++chambIt) {
91 for (
int i = 0;
i < 5; ++
i) {
92 for (
int j = 0;
j < 6; ++
j) {
93 for (
int k = 0;
k < 13; ++
k) {
102 vector<L1MuDTChambPhDigi>
const* phTrigs = l1DTTPGPh->
getContainer();
104 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
105 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
106 for (; iph != iphe; ++iph) {
107 int phwheel = iph->whNum();
108 int phsec = iph->scNum() + 1;
109 int phst = iph->stNum();
110 int phcode = iph->code();
112 if (phcode >
phCodeBestTM[phwheel + 3][phst][phsec] && phcode < 7) {
118 vector<const DTRecSegment4D*> bestSegments4D;
124 for (chambIdIt = segments4D->id_begin(); chambIdIt != segments4D->id_end(); ++chambIdIt) {
131 if ((*track).hasPhi()) {
132 hits = (*track).phiSegment()->degreesOfFreedom() + 2;
133 if (
hits > hitsBest) {
140 bestSegments4D.push_back(best);
145 vector<const DTRecSegment4D*>::const_iterator bestSegIt = bestSegments4D.begin();
146 vector<const DTRecSegment4D*>::const_iterator bestSegEnd = bestSegments4D.end();
147 for (; bestSegIt != bestSegEnd; ++bestSegIt) {
148 float dir = atan((*bestSegIt)->localDirection().x() / (*bestSegIt)->localDirection().z()) * 180 /
156 float t0seg = (*bestSegIt)->phiSegment()->t0();
162 int sector = chambId.
sector();
164 int scsector = sector > 12 ? sector == 13 ? 4 : 10 : sector;
168 if (fabs(t0seg) > 0.01) {
169 innerME.find(
"SEG_TrackCrossingTime")->second->Fill(htime);
171 innerME.find(
"TM_TrackCrossingTimeAll")->second->Fill(htime);
173 innerME.find(
"TM_TrackCrossingTimeHH")->second->Fill(htime);
185 sector << dtChId.
sector();
186 uint32_t chRawId = dtChId.
rawId();
190 std::vector<string> histoTags = {
"SEG_TrackCrossingTime",
"TM_TrackCrossingTimeAll",
"TM_TrackCrossingTimeHH"};
196 for (
const auto&
histoTag : histoTags) {
200 <<
"[DTLocalTriggerSynchTask]: booking " <<
baseDir() +
"/Wheel" <<
wheel.str() <<
"/Sector" << sector.str()
206 string floatTag[2] = {
"tTrig_SL1",
"tTrig_SL3"};
208 for (
int iFloat = 0; iFloat < 2; ++iFloat) {
209 string floatName = floatTag[iFloat] +
"_W" +
wheel.str() +
"_Sec" + sector.str() +
"_St" +
station.str();
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
constexpr int32_t ceil(float num)
T getParameter(std::string const &) const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
std::pair< const_iterator, const_iterator > range
iterator range
virtual void setCurrentFolder(std::string const &fullpath)
void analyze(const edm::Event &event, const edm::EventSetup &context) override
Analyze.
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Beginrun.
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
std::unique_ptr< DTTTrigBaseSync > tTrigSync
C::const_iterator const_iterator
constant access iterator type
DTLocalTriggerSynchTask(const edm::ParameterSet &ps)
Constructor.
const DTGeometry * muonGeom
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Book the histograms.
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
Phi_Container const * getContainer() const
constexpr uint32_t rawId() const
get the raw id
int degreesOfFreedom() const override
return the DOF of the segment
std::map< uint32_t, std::map< std::string, MonitorElement * > > triggerHistos
int wheel() const
Return the wheel number.
void bookHistos(DQMStore::IBooker &, const DTChamberId &dtCh)
Book the histograms.
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
~DTLocalTriggerSynchTask() override
Destructor.