160 events_per_bx = ibooker.
book1D(
"events per BX",
"rp;Event.BX", 4002, -1.5, 4000. + 0.5);
161 events_per_bx_short = ibooker.
book1D(
"events per BX (short)",
"rp;Event.BX", 102, -1.5, 100. + 0.5);
163 h_trackCorr_hor = ibooker.
book2D(
"track correlation RP-210-hor",
"rp, 210, hor", 4, -0.5, 3.5, 4, -0.5, 3.5);
164 TH2F *
hist = h_trackCorr_hor->getTH2F();
165 TAxis *xa = hist->GetXaxis(), *ya = hist->GetYaxis();
166 xa->SetBinLabel(1,
"45, 210, near"); ya->SetBinLabel(1,
"45, 210, near");
167 xa->SetBinLabel(2,
"45, 210, far"); ya->SetBinLabel(2,
"45, 210, far");
168 xa->SetBinLabel(3,
"56, 210, near"); ya->SetBinLabel(3,
"56, 210, near");
169 xa->SetBinLabel(4,
"56, 210, far"); ya->SetBinLabel(4,
"56, 210, far");
178 bool diag = (top45 != top56);
181 sprintf(name,
"%s 45%s - 56%s",
182 (diag) ?
"diagonal" :
"antidiagonal",
183 (top45) ?
"top" :
"bot",
184 (top56) ?
"top" :
"bot"
189 h_lrc_x_d = ibooker.
book2D(
"dx left vs right",
string(name) +
" : dx left vs. right, histogram;#Delta x_{45};#Delta x_{56}", 50, 0., 0., 50, 0., 0.);
190 h_lrc_x_n = ibooker.
book2D(
"xn left vs right",
string(name) +
" : xn left vs. right, histogram;x^{N}_{45};x^{N}_{56}", 50, 0., 0., 50, 0., 0.);
191 h_lrc_x_f = ibooker.
book2D(
"xf left vs right",
string(name) +
" : xf left vs. right, histogram;x^{F}_{45};x^{F}_{56}", 50, 0., 0., 50, 0., 0.);
193 h_lrc_y_d = ibooker.
book2D(
"dy left vs right",
string(name) +
" : dy left vs. right, histogram;#Delta y_{45};#Delta y_{56}", 50, 0., 0., 50, 0., 0.);
194 h_lrc_y_n = ibooker.
book2D(
"yn left vs right",
string(name) +
" : yn left vs. right, histogram;y^{N}_{45};y^{N}_{56}", 50, 0., 0., 50, 0., 0.);
195 h_lrc_y_f = ibooker.
book2D(
"yf left vs right",
string(name) +
" : yf left vs. right, histogram;y^{F}_{45};y^{F}_{56}", 50, 0., 0., 50, 0., 0.);
203 path.replace(0, 2,
"TrackingStrip");
212 h_trackCorr = ibooker.
book2D(
"track RP correlation", title, 13, -0.5, 12.5, 13, -0.5, 12.5);
214 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
215 xa->SetBinLabel(1,
"210, near, top"); ya->SetBinLabel(1,
"210, near, top");
216 xa->SetBinLabel(2,
"bot"); ya->SetBinLabel(2,
"bot");
217 xa->SetBinLabel(3,
"hor"); ya->SetBinLabel(3,
"hor");
218 xa->SetBinLabel(4,
"far, hor"); ya->SetBinLabel(4,
"far, hor");
219 xa->SetBinLabel(5,
"top"); ya->SetBinLabel(5,
"top");
220 xa->SetBinLabel(6,
"bot"); ya->SetBinLabel(6,
"bot");
221 xa->SetBinLabel(8,
"220, near, top"); ya->SetBinLabel(8,
"220, near, top");
222 xa->SetBinLabel(9,
"bot"); ya->SetBinLabel(9,
"bot");
223 xa->SetBinLabel(10,
"hor"); ya->SetBinLabel(10,
"hor");
224 xa->SetBinLabel(11,
"far, hor"); ya->SetBinLabel(11,
"far, hor");
225 xa->SetBinLabel(12,
"top"); ya->SetBinLabel(12,
"top");
226 xa->SetBinLabel(13,
"bot"); ya->SetBinLabel(13,
"bot");
230 xa = h_trackCorr_h->GetXaxis(); ya = h_trackCorr_h->GetYaxis();
231 xa->SetBinLabel(1,
"210, near, top"); ya->SetBinLabel(1,
"210, near, top");
232 xa->SetBinLabel(2,
"bot"); ya->SetBinLabel(2,
"bot");
233 xa->SetBinLabel(3,
"hor"); ya->SetBinLabel(3,
"hor");
234 xa->SetBinLabel(4,
"far, hor"); ya->SetBinLabel(4,
"far, hor");
235 xa->SetBinLabel(5,
"top"); ya->SetBinLabel(5,
"top");
236 xa->SetBinLabel(6,
"bot"); ya->SetBinLabel(6,
"bot");
237 xa->SetBinLabel(8,
"220, near, top"); ya->SetBinLabel(8,
"220, near, top");
238 xa->SetBinLabel(9,
"bot"); ya->SetBinLabel(9,
"bot");
239 xa->SetBinLabel(10,
"hor"); ya->SetBinLabel(10,
"hor");
240 xa->SetBinLabel(11,
"far, hor"); ya->SetBinLabel(11,
"far, hor");
241 xa->SetBinLabel(12,
"top"); ya->SetBinLabel(12,
"top");
242 xa->SetBinLabel(13,
"bot"); ya->SetBinLabel(13,
"bot");
250 path.replace(0, 2,
"TrackingStrip");
260 path.replace(0, 2,
"TrackingStrip");
265 vfat_problem = ibooker.
book2D(
"vfats with any problem", title+
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
266 vfat_missing = ibooker.
book2D(
"vfats missing", title+
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
267 vfat_ec_bc_error = ibooker.
book2D(
"vfats with EC or BC error", title+
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
268 vfat_corruption = ibooker.
book2D(
"vfats with data corruption", title+
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
270 activity = ibooker.
book1D(
"active planes", title+
";number of active planes", 11, -0.5, 10.5);
271 activity_u = ibooker.
book1D(
"active planes U", title+
";number of active U planes", 11, -0.5, 10.5);
272 activity_v = ibooker.
book1D(
"active planes V", title+
";number of active V planes", 11, -0.5, 10.5);
274 activity_per_bx = ibooker.
book1D(
"activity per BX", title+
";Event.BX", 4002, -1.5, 4000. + 0.5);
275 activity_per_bx_short = ibooker.
book1D(
"activity per BX (short)", title+
";Event.BX", 102, -1.5, 100. + 0.5);
277 hit_plane_hist = ibooker.
book2D(
"activity in planes (2D)", title+
";plane number;strip number", 10, -0.5, 9.5, 32, -0.5, 511.5);
279 patterns_u = ibooker.
book1D(
"recognized patterns U", title+
";number of recognized U patterns", 11, -0.5, 10.5);
280 patterns_v = ibooker.
book1D(
"recognized patterns V", title+
";number of recognized V patterns", 11, -0.5, 10.5);
282 h_planes_fit_u = ibooker.
book1D(
"planes contributing to fit U", title+
";number of planes contributing to U fit", 6, -0.5, 5.5);
283 h_planes_fit_v = ibooker.
book1D(
"planes contributing to fit V", title+
";number of planes contributing to V fit", 6, -0.5, 5.5);
285 event_category = ibooker.
book1D(
"event category", title+
";event category", 5, -0.5, 4.5);
286 TH1F *event_category_h = event_category->
getTH1F();
287 event_category_h->GetXaxis()->SetBinLabel(1,
"empty");
288 event_category_h->GetXaxis()->SetBinLabel(2,
"insufficient");
289 event_category_h->GetXaxis()->SetBinLabel(3,
"single-track");
290 event_category_h->GetXaxis()->SetBinLabel(4,
"multi-track");
291 event_category_h->GetXaxis()->SetBinLabel(5,
"shower");
293 trackHitsCumulativeHist = ibooker.
book2D(
"track XY profile", title+
";x (mm);y (mm)", 100, -18., +18., 100, -18., +18.);
295 track_u_profile = ibooker.
book1D(
"track profile U", title+
"; U (mm)", 512, -256*66E-3, +256*66E-3);
296 track_v_profile = ibooker.
book1D(
"track profile V", title+
"; V (mm)", 512, -256*66E-3, +256*66E-3);
305 path.replace(0, 2,
"TrackingStrip");
310 digi_profile_cumulative = ibooker.
book1D(
"digi profile", title+
";strip number", 512, -0.5, 511.5);
311 cluster_profile_cumulative = ibooker.
book1D(
"cluster profile", title+
";cluster center", 1024, -0.25, 511.75);
312 hit_multiplicity = ibooker.
book1D(
"hit multiplicity", title+
";hits/detector/event", 6, -0.5, 5.5);
313 cluster_size = ibooker.
book1D(
"cluster size", title+
";hits per cluster", 5, 0.5, 5.5);
315 efficiency_num = ibooker.
book1D(
"efficiency num", title+
";track position (mm)", 30, -15., 0.);
316 efficiency_den = ibooker.
book1D(
"efficiency den", title+
";track position (mm)", 30, -15., 0.);
323 verbosity(ps.getUntrackedParameter<unsigned int>(
"verbosity", 0))
369 for (
unsigned int arm = 0; arm < 2; arm++)
374 for (
unsigned int st = 0; st < 3; st += 2)
376 unsigned int stId = 10*arm + st;
381 for (
unsigned int rp = 0; rp < 6; ++rp)
383 unsigned int rpId = 10*stId + rp;
388 for (
unsigned int pl = 0; pl < 10; ++pl)
390 unsigned int plId = 10*rpId + pl;
450 "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n"
451 <<
" status.isValid = " << status.
isValid() <<
"\n"
452 <<
" digi.isValid = " << digi.
isValid() <<
"\n"
453 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n"
454 <<
" hits.isValid = " << hits.
isValid() <<
"\n"
455 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n"
456 <<
" tracks.isValid = " << tracks.
isValid();
469 for (
auto &ds1 : *tracks)
471 for (
auto &tr1 : ds1)
476 unsigned int rpId1 = ds1.detId();
477 unsigned int arm1 = rpId1 / 100;
478 unsigned int stNum1 = (rpId1 / 10) % 10;
479 unsigned int rpNum1 = rpId1 % 10;
480 if (stNum1 != 0 || (rpNum1 != 2 && rpNum1 != 3))
482 unsigned int idx1 = arm1*2 + rpNum1-2;
484 for (
auto &ds2 : *tracks)
486 for (
auto &tr2 : ds2)
491 unsigned int rpId2 = ds2.detId();
492 unsigned int arm2 = rpId2 / 100;
493 unsigned int stNum2 = (rpId2 / 10) % 10;
494 unsigned int rpNum2 = rpId2 % 10;
495 if (stNum2 != 0 || (rpNum2 != 2 && rpNum2 != 3))
497 unsigned int idx2 = arm2*2 + rpNum2-2;
508 for (
auto &ds : *status)
511 unsigned int rpId = decId / 10;
512 unsigned int plNum = decId % 10;
520 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
521 plots.vfat_missing->Fill(plNum,
s.getChipPosition());
524 if (
s.isECProgressError() ||
s.isBCProgressError())
526 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
527 plots.vfat_ec_bc_error->Fill(plNum,
s.getChipPosition());
530 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError())
532 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
533 plots.vfat_corruption->Fill(plNum,
s.getChipPosition());
547 planePlots[DetId].digi_profile_cumulative->Fill(dit->getStripNumber());
557 planePlots[DetId].cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
565 planePlots[DetId].hit_multiplicity->Fill(it->size());
573 planePlots[DetId].cluster_size->Fill(dit->getNumberOfStrips());
577 for (
auto &ds : *tracks)
579 unsigned int rpId = ds.detId();
586 double rp_z = geometry->GetRPGlobalTranslation(rpId).z();
588 for (
unsigned int plNum = 0; plNum < 10; ++plNum)
590 unsigned int plDecId = rpId*10 + plNum;
593 double ft_z = ft.getZ0();
594 double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
595 double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
597 double ft_v = geometry->GlobalToLocal(plRawId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
599 bool hasMatchingHit =
false;
600 const auto &hit_ds_it = hits->find(plRawId);
601 if (hit_ds_it != hits->end())
603 for (
const auto &
h : *hit_ds_it)
605 bool match = (fabs(ft_v -
h.getPosition()) < 2.*0.066);
608 hasMatchingHit =
true;
616 pp.efficiency_den->Fill(ft_v);
618 pp.efficiency_num->Fill(ft_v);
628 map<unsigned int, set<unsigned int> > planes;
629 map<unsigned int, set<unsigned int> > planes_u;
630 map<unsigned int, set<unsigned int> > planes_v;
631 for (
const auto &ds : *hits)
638 unsigned int planeNum = DetId % 10;
639 planes[RPId].insert(planeNum);
641 planes_u[RPId].insert(planeNum);
643 planes_v[RPId].insert(planeNum);
646 for (
const auto &ds : *status)
648 bool activity =
false;
649 for (
const auto &
s : ds)
651 if (
s.isNumberOfClustersSpecified() &&
s.getNumberOfClusters() > 0)
663 unsigned int planeNum = DetId % 10;
664 planes[RPId].insert(planeNum);
666 planes_u[RPId].insert(planeNum);
668 planes_v[RPId].insert(planeNum);
672 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++)
674 it->second.activity->Fill(planes[it->first].size());
675 it->second.activity_u->Fill(planes_u[it->first].size());
676 it->second.activity_v->Fill(planes_v[it->first].size());
678 if (planes[it->first].size() >= 6)
681 it->second.activity_per_bx_short->Fill(event.
bunchCrossing());
689 unsigned int planeNum = DetId % 10;
696 for (
auto &ds : *patterns)
698 unsigned int rpId = ds.detId();
702 unsigned int u = 0,
v = 0;
705 if (!
p.getFittable())
722 const unsigned int &
id = it.first;
723 auto &
pp = it.second;
726 unsigned int pl_u = planes_u[id].size();
727 unsigned int pl_v = planes_v[id].size();
730 const auto &rp_pat_it = patterns->find(
id);
732 unsigned int pat_u = 0, pat_v = 0;
733 if (rp_pat_it != patterns->end())
735 for (
auto &
p : *rp_pat_it)
737 if (!
p.getFittable())
751 if (pl_u == 0 && pl_v == 0) category = 0;
753 if (category == -1 && pat_u + pat_v <= 1)
761 if (pat_u == 1 && pat_v == 1) category = 2;
763 if (category == -1) category = 3;
765 pp.event_category->Fill(category);
769 for (
auto &ds : *tracks)
771 unsigned int RPId = ds.detId();
780 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
781 for (
auto &hds : ft.getHits())
783 unsigned int rawId = hds.detId();
807 CLHEP::Hep3Vector rod_U = geometry->LocalToGlobalDirection(
TotemRPDetId::decToRawId(RPId*10 + 1), CLHEP::Hep3Vector(0., 1., 0.));
808 CLHEP::Hep3Vector rod_V = geometry->LocalToGlobalDirection(
TotemRPDetId::decToRawId(RPId*10 + 0), CLHEP::Hep3Vector(0., 1., 0.));
810 double x = ft.getX0() - rp_x;
811 double y = ft.getY0() - rp_y;
815 double U = x * rod_U.x() + y * rod_U.y();
816 double V = x * rod_V.x() + y * rod_V.y();
830 map<unsigned int, unsigned int> mTop, mHor, mBot;
839 for (
auto &ds : *tracks)
841 unsigned int rpId = ds.detId();
842 unsigned int armNum = rpId / 100;
843 unsigned int rpNum = rpId % 10;
850 if (rpNum == 0 || rpNum == 4)
852 if (rpNum == 2 || rpNum == 3)
854 if (rpNum == 1 || rpNum == 5)
859 for (
auto &
p : armPlots)
861 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first]);
862 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first]);
863 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first]);
867 for (
auto &ds1 : *tracks)
869 for (
auto &tr1 : ds1)
874 unsigned int rpId1 = ds1.detId();
875 unsigned int arm1 = rpId1 / 100;
876 unsigned int stNum1 = (rpId1 / 10) % 10;
877 unsigned int rpNum1 = rpId1 % 10;
878 unsigned int idx1 = stNum1/2 * 7 + rpNum1;
879 bool hor1 = (rpNum1 == 2 || rpNum1 == 3);
883 for (
auto &ds2 : *tracks)
885 for (
auto &tr2 : ds2)
890 unsigned int rpId2 = ds2.detId();
891 unsigned int arm2 = rpId2 / 100;
892 unsigned int stNum2 = (rpId2 / 10) % 10;
893 unsigned int rpNum2 = rpId2 % 10;
894 unsigned int idx2 = stNum2/2 * 7 + rpNum2;
895 bool hor2 = (rpNum2 == 2 || rpNum2 == 3);
MonitorElement * event_category
T getParameter(std::string const &) const
MonitorElement * h_lrc_x_n
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * cluster_profile_cumulative
static std::string rpName(unsigned int id, NameFlag flag=nFull)
returns official name of a RP characterized by ''id''; if ''full'' is true, name of station is prefix...
MonitorElement * activity
void Init(DQMStore::IBooker &ibooker)
MonitorElement * h_trackCorr_overlap
MonitorElement * vfat_corruption
MonitorElement * cluster_size
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static unsigned int rpOfDet(unsigned int i)
returns ID of RP for given detector ID ''i''
static std::string planeName(unsigned int id, NameFlag flag=nFull)
returns official name of a plane characterized by ''id''; if ''full'' is true, name of RP is prefixed...
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
MonitorElement * h_planes_fit_u
#define DEFINE_FWK_MODULE(type)
MonitorElement * activity_per_bx
std::map< unsigned int, ArmPlots > armPlots
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
int bunchCrossing() const
static unsigned int rawToDecId(unsigned int raw)
fast conversion Raw to Decimal ID
MonitorElement * events_per_bx
MonitorElement * h_lrc_x_f
MonitorElement * track_u_profile
bool isStripsCoordinateUDirection() const
MonitorElement * h_trackCorr
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
MonitorElement * h_lrc_y_d
Event setup record containing the real (actual) geometry information.
MonitorElement * h_numRPWithTrack_top
static std::string stationName(unsigned int id, NameFlag flag=nFull)
returns official name of a station characterized by ''id''; if ''full'' is true, name of arm is prefi...
const PhiMemoryImage patterns[9]
plots related to one RP plane
std::map< unsigned int, PlanePlots > planePlots
MonitorElement * h_numRPWithTrack_hor
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > tokenRecHit
MonitorElement * activity_v
MonitorElement * efficiency_den
MonitorElement * h_lrc_y_f
MonitorElement * patterns_v
plots related to one (anti)diagonal
virtual ~TotemRPDQMSource()
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPattern
MonitorElement * h_numRPWithTrack_bot
MonitorElement * efficiency_num
MonitorElement * book1D(Args &&...args)
MonitorElement * h_trackCorr_hor
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
MonitorElement * events_per_bx_short
MonitorElement * vfat_missing
MonitorElement * track_v_profile
void endLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
plots related to one station
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
MonitorElement * hit_multiplicity
MonitorElement * hit_plane_hist
std::map< unsigned int, StationPlots > stationPlots
void setCurrentFolder(const std::string &fullpath)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
MonitorElement * book2D(Args &&...args)
TH1F * getTH1F(void) const
MonitorElement * patterns_u
MonitorElement * h_lrc_x_d
MonitorElement * activity_u
TotemRPDQMSource(const edm::ParameterSet &ps)
MonitorElement * vfat_ec_bc_error
ESHandle< TrackerGeometry > geometry
static std::string armName(unsigned int id, NameFlag flag=nFull)
returns official name of an arm characterized by ''id''; if ''full'' is true, prefix rp_ added ...
MonitorElement * vfat_problem
std::map< unsigned int, PotPlots > potPlots
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
plots related to the whole system
std::map< unsigned int, DiagonalPlots > diagonalPlots
TH2F * getTH2F(void) const
MonitorElement * h_planes_fit_v
MonitorElement * digi_profile_cumulative
MonitorElement * h_lrc_y_n
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
static unsigned int decToRawId(unsigned int dec)
fast conversion Decimal to Raw ID
MonitorElement * activity_per_bx_short
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus
MonitorElement * trackHitsCumulativeHist