18 #include "GaudiKernel/IInterface.h"
19 #include "GaudiKernel/StatusCode.h"
42 static const unsigned int bcid_start = 0;
43 static const unsigned int bcids_displayed = 3570;
44 static const signed int ecr_start = 0;
45 static const unsigned int ecrs_displayed = 256;
46 static const unsigned int bc_readout = 31;
47 static const unsigned int lb_start = 0;
48 static const unsigned int lb_max = 5000;
52 const std::string &
type,
53 const std::string &
name,
57 m_pulse_width_all{
nullptr,
nullptr},
58 m_hits_lvl1a{
nullptr,
nullptr},
59 m_hits_bcid{
nullptr,
nullptr},
60 m_hitdistribution{
nullptr,
nullptr},
61 m_pulse_position_gen{
nullptr,
nullptr},
62 m_pulse_width_gen{
nullptr,
nullptr},
63 m_strange_signals{
nullptr,
nullptr},
65 m_deltat_vs_hits{
nullptr,
nullptr},
66 m_deltat_aligned_vs_hits{
nullptr,
nullptr},
67 m_deltat_vs_bcid{
nullptr,
nullptr},
68 m_deltat_aligned_vs_bcid{
nullptr,
nullptr},
69 m_deltat_vs_lb{
nullptr,
nullptr},
70 m_deltat_aligned_vs_lb{
nullptr,
nullptr},
71 m_deltat_vs_ecr{
nullptr,
nullptr},
72 m_deltat_aligned_vs_ecr{
nullptr,
nullptr},
73 m_deltat_vs_PrVertex{
nullptr,
nullptr},
74 m_deltat_vs_pixhits{
nullptr,
nullptr},
75 m_deltat_vs_pixhitsEC{
nullptr,
nullptr},
76 m_deltat_vs_pixhitsBR{
nullptr,
nullptr},
77 m_deltat_vs_scthits{
nullptr,
nullptr},
78 m_deltat_vs_scthitsBR{
nullptr,
nullptr},
79 m_sct_vs_pix_col{
nullptr,
nullptr},
80 m_sct_vs_pix_bkg{
nullptr,
nullptr}
83 declareProperty(
"histFolder",m_histFolder=
"InDetGlobal/PrimaryVertex");
91 return StatusCode::SUCCESS;
114 name =
"HitsVsLvl1AAll";
115 title =
"Hits vs LVL1A All";
120 name =
"ChannelVsLvl1a";
121 title =
"Channel vs LVL1 A";
126 name =
"ChannelVsBCID";
127 title =
"Channel vs BCID";
132 name =
"ChannelVsECR";
133 title =
"Channel vs ECR";
138 name =
"NumberOfEvents";
139 title =
"Number of monitored events";
141 m_NumberOfEvents->GetXaxis()->SetTitle(
"sourceID [0=BCM, 1=LowHorizontal, 2=LowVertical]");
144 name =
"AbortFraction";
145 title =
"Abort Fraction";
150 name =
"AbortFractionROD0";
151 title =
"Abort Fraction ROD0";
156 name =
"AbortFractionROD1";
157 title =
"Abort Fraction ROD1";
162 name =
"AbortFractionVsBCID";
163 title =
"Abort Fraction Vs BCID";
168 name =
"AbortFractionROD0VsBCID";
169 title =
"Abort Fraction ROD0 Vs BCID";
174 name =
"AbortFractionROD1VsBCID";
175 title =
"Abort Fraction ROD1 Vs BCID";
180 name =
"AbortFractionVsECR";
181 title =
"Abort Fraction Vs ECR";
186 name =
"AbortFractionVsLB";
187 title =
"Abort Fraction Vs LB";
192 name =
"AbortFractionROD0VsECR";
193 title =
"Abort Fraction ROD0 Vs ECR";
198 name =
"AbortFractionROD1VsECR";
199 title =
"Abort Fraction ROD1 Vs ECR";
204 name =
"timewalkAll";
205 title =
"timewalk All";
207 m_timewalk_all->GetXaxis()->SetTitle(
"pulse pos in time bins [25/64 ns]");
208 m_timewalk_all->GetYaxis()->SetTitle(
"pulse width in time bins [25/64 ns]");
210 name =
"NumberHighOccupancyEventsVsLB";
211 title =
"Number of High Occupancy Events Vs LB";
213 m_highocc->GetXaxis()->SetTitle(
"LB number");
214 m_highocc->GetYaxis()->SetTitle(
"Number of High Occupancy Events");
221 for (
unsigned int gain_value=0;gain_value<2;gain_value++)
223 if (gain_value==0){
gain =
"Low";}
226 name =
"PulsePositionAll";
227 title =
"Pulse Position All";
232 name =
"PulseWidthAll";
233 title =
"Pulse Width All";
238 name =
"HitDistribution" +
gain +
"Gain";
239 title =
"Hits vs Channel " +
gain +
" Gain";
244 name =
"HitsVsLvl1A" +
gain +
"Gain";
245 title =
"Hits vs LVL1 A " +
gain +
" Gain";
247 m_hits_lvl1a[gain_value]->GetXaxis()->SetTitle(
"lvl1a [25 ns]");
248 m_hits_lvl1a[gain_value]->GetYaxis()->SetTitle(
"# of hits");
250 name =
"HitsVsBCID" +
gain +
"Gain";
251 title =
"Hits vs BCID " +
gain +
" Gain";
253 m_hits_bcid[gain_value]->GetXaxis()->SetTitle(
"BCID [25 ns]");
254 m_hits_bcid[gain_value]->GetYaxis()->SetTitle(
"# of hits");\
256 name =
"StrangeSignals" +
gain +
"Gain";
257 title =
"Strange Signals " +
gain +
" Gain";
262 name =
"PulsePosition" +
gain +
"Gain";
263 title =
"Pulse Position " +
gain +
" Gain";
268 name =
"PulseWidth" +
gain +
"Gain";
280 name =
"DeltatAligned" +
gain +
"Gain";
281 title =
"#Delta t Aligned " +
gain +
" Gain";
286 name =
"DeltatVsBCID" +
gain +
"Gain";
287 title =
"#Delta t vs BCID " +
gain +
" Gain";
292 name =
"DeltatAlignedVsBCID" +
gain +
"Gain";
293 title =
"#Delta t Aligned vs BCID " +
gain +
" Gain";
298 name =
"DeltatVsLB" +
gain +
"Gain";
299 title =
"#Delta t vs LB " +
gain +
" Gain";
302 m_deltat_vs_lb[gain_value]->GetYaxis()->SetTitle(
"#Delta t [ns]");
304 name =
"DeltatAlignedVsLB" +
gain +
"Gain";
305 title =
"#Delta t Aligned vs LB " +
gain +
" Gain";
310 name =
"DeltatVsECR" +
gain +
"Gain";
311 title =
"#Delta t vs ECR " +
gain +
" Gain";
316 name =
"DeltatAlignedVsECR" +
gain +
"Gain";
317 title =
"#Delta t Aligned vs ECR " +
gain +
" Gain";
322 name =
"DeltatVsPrVertex" +
gain +
"Gain";
323 title =
"#Delta t vs Primary Vertex " +
gain +
" Gain";
328 name =
"DeltatVsPixelHits" +
gain +
"Gain";
329 title =
"#Delta t vs NumberPixelHits " +
gain +
" Gain";
334 name =
"DeltatVsPixelHitsBR" +
gain +
"Gain";
335 title =
"#Delta t vs NumberPixelHits in Barrel " +
gain +
" Gain";
340 name =
"DeltatVsPixelHitsEC" +
gain +
"Gain";
341 title =
"#Delta t vs NumberPixelHits in Endcap " +
gain +
" Gain";
346 name =
"DeltatVsSctHits" +
gain +
"Gain";
347 title =
"#Delta t vs NumberSctHits " +
gain +
" Gain";
352 name =
"DeltatVsSctHitsBR" +
gain +
"Gain";
353 title =
"#Delta t vs NumberSctHits in Barrel " +
gain +
" Gain";
358 name =
"DeltatVsSctHitsEC" +
gain +
"Gain";
359 title =
"#Delta t vs NumberSctHits in Endcap " +
gain +
" Gain";
364 name =
"SctVsPixHitsCol" +
gain +
"Gain";
365 title =
"#NumberSctHits vs NumberPixHits w/ Collison delta t " +
gain +
" Gain";
370 name =
"SctVsPixHitsBkg" +
gain +
"Gain";
371 title =
"#NumberSctHits vs NumberPixHits w/ Background delta t " +
gain +
" Gain";
376 for (
unsigned int pulse_nr=0;pulse_nr<2;pulse_nr++) {
378 if (pulse_nr==0){pulse =
"1";}
381 name=
"Pulse"+pulse+
"Width"+
gain+
"Gain";
382 title=
"Pulse"+ pulse +
"Width" +
gain +
"Gain";
384 m_pulse_width[gain_value][pulse_nr]->GetXaxis()->SetTitle(
"time bins [25/32 ns]");
385 m_pulse_width[gain_value][pulse_nr]->GetYaxis()->SetTitle(
"# of hits");
387 name=
"Pulse"+pulse+
"Position"+
gain+
"Gain";
388 title =
"Pulse " + pulse +
" Position " +
gain +
" Gain";
390 m_pulse_position[gain_value][pulse_nr]->GetXaxis()->SetTitle(
"time bins [25/64 ns]");
393 name =
"HitDistributionPulse"+pulse+
gain+
"Gain";
394 title =
"Hitdistribution Pulse " + pulse +
" " +
gain +
" Gain";
406 for(
unsigned int station_nr=0;station_nr<2;station_nr++)
411 for (
unsigned int gain_value=0;gain_value<2;gain_value++)
413 if (gain_value==0){
gain=
"Low";}
419 m_stat_lvl1a[station_nr][gain_value]->GetXaxis()->SetTitle(
"lvl1a [25 ns]");
420 m_stat_lvl1a[station_nr][gain_value]->GetYaxis()->SetTitle(
"# of hits");
434 for (
unsigned int pulse_nr=0; pulse_nr<2;pulse_nr++)
436 if (pulse_nr==0){pulse=
"1";}
442 m_stat_pulse_position[station_nr][gain_value][pulse_nr]->GetXaxis()->SetTitle(
"time bins [25/64 ns]");
448 m_stat_pulse_width[station_nr][gain_value][pulse_nr]->GetXaxis()->SetTitle(
"time bins [25/32 ns]");
449 m_stat_pulse_width[station_nr][gain_value][pulse_nr]->GetYaxis()->SetTitle(
"# of hits");
458 std::string detector_name;
492 for (
unsigned int gain_value=0;gain_value<2;gain_value++)
494 if (gain_value==0){
gain=
"Low";}
521 for (
unsigned int pulse_nr=0;pulse_nr<2;pulse_nr++) {
522 if (pulse_nr==0){pulse=
"1";}
541 if (
status)
return StatusCode::SUCCESS;
542 else return StatusCode::FAILURE;
606 if (
msgLvl(MSG::WARNING) ){
607 msg(MSG::WARNING) <<
"Could not retrieve the event information container" <<
endmsg;
614 std::vector<std::list<deltat_data> > positions_A(2);
615 std::vector<std::list<deltat_data> > positions_C(2);
625 return StatusCode::SUCCESS;
629 if (vxContainer->
size() == 1) {
639 if ((*vxIter)->vertexType() !=
Trk::PriVtx)
continue;
640 z = (*vxIter)->recVertex().position().z();
658 int nROD0HitLG[bc_readout] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
659 int nROD0HitHG[bc_readout] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
660 int nROD1HitLG[bc_readout] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
661 int nROD1HitHG[bc_readout] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
662 int nROD0BCID[bc_readout] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
663 int nROD1BCID[bc_readout] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
665 unsigned int ecr = -1;
669 int channel_counter = -1;
671 for (; BCM_RDO_itr != BCM_RDO_itr_end; ++BCM_RDO_itr) {
673 if ( !(*BCM_RDO_itr)->empty()) {
678 for (; RDO_element != RDO_element_last; ++RDO_element){
680 if (*RDO_element ==
nullptr)
686 int bcm_lvl1a = (*RDO_element)->getLVL1A();
687 int bcm_channel = (*RDO_element)->getChannel();
688 int bcm_bcid = (*RDO_element)->getBCID();
689 int bcm_pulse1position = (*RDO_element)->getPulse1Position();
690 int bcm_pulse1width = (*RDO_element)->getPulse1Width();
691 int bcm_pulse2position = (*RDO_element)->getPulse2Position();
692 int bcm_pulse2width = (*RDO_element)->getPulse2Width();
701 if (channel_counter == 0 || channel_counter == 2 || channel_counter == 4 || channel_counter == 6 || channel_counter == 9 || channel_counter == 11 || channel_counter == 13 || channel_counter == 15) ROD = 0;
703 if (bcm_pulse1width>0 || bcm_pulse2width>0){
704 if (ROD == 0 && channel_counter < 8 && nROD0HitLG[BC_counter]<3) nROD0HitLG[BC_counter]++;
705 if (ROD == 1 && channel_counter < 8 && nROD1HitLG[BC_counter]<3) nROD1HitLG[BC_counter]++;
706 if (ROD == 0) nROD0BCID[BC_counter] = bcm_bcid;
707 if (ROD == 0 && channel_counter > 7 && nROD0HitHG[BC_counter]<3) nROD0HitHG[BC_counter]++;
708 if (ROD == 1 && channel_counter > 7 && nROD1HitHG[BC_counter]<3) nROD1HitHG[BC_counter]++;
709 if (ROD == 1) nROD1BCID[BC_counter] = bcm_bcid;
715 if (ROD0 && (bcm_channel == 0 || bcm_channel == 2 || bcm_channel == 4 || bcm_channel == 6 || bcm_channel == 9 || bcm_channel == 11 || bcm_channel == 13 || bcm_channel == 15)){
720 if (ROD1 && (bcm_channel == 1 || bcm_channel == 3 || bcm_channel == 5 || bcm_channel == 7 || bcm_channel == 8 || bcm_channel == 10 || bcm_channel == 12 || bcm_channel == 14)){
726 if ( bcm_pulse1width !=0 || bcm_pulse2width !=0){
729 if (( bcm_pulse1width == 0 && bcm_pulse2width == 0) && (bcm_pulse1position !=0 || bcm_pulse2position !=0)){
741 if ( bcm_channel < 8 ){
749 if (bcm_channel > 7){
763 if (bcm_channel < 4){
769 s1a.
lvl1a = bcm_lvl1a;
770 positions_A[0].push_back(s1a);
771 if (bcm_pulse2width != 0){
777 s2a.
lvl1a = bcm_lvl1a;
778 positions_A[0].push_back(s2a);
785 if (bcm_channel > 7 && bcm_channel < 12){
791 s1a.
lvl1a = bcm_lvl1a;
792 positions_A[1].push_back(s1a);
793 if (bcm_pulse2width != 0){
799 s2a.
lvl1a = bcm_lvl1a;
800 positions_A[1].push_back(s2a);
806 if (bcm_channel > 3 && bcm_channel < 8){
812 s1c.
lvl1a = bcm_lvl1a;
813 positions_C[0].push_back(s1c);
814 if (bcm_pulse2width != 0){
820 s2c.
lvl1a = bcm_lvl1a;
821 positions_C[0].push_back(s2c);
827 if (bcm_channel > 11){
833 s1c.
lvl1a = bcm_lvl1a;
834 positions_C[1].push_back(s1c);
835 if (bcm_pulse2width != 0){
841 s2c.
lvl1a = bcm_lvl1a;
842 positions_C[1].push_back(s2c);
851 switch (bcm_channel){
926 unsigned int n_pix_hits[3] = {0};
931 for( ; colNextpix != colNextpix_end; ++colNextpix){
933 if(!PIX_Collection)
continue;
939 n_pix_hits[1] += PIX_Collection->
size();
942 n_pix_hits[0] += PIX_Collection->
size();
945 n_pix_hits[2] += PIX_Collection->
size();
955 unsigned int n_sct_hits[3] = {0};
960 for( ; colNextsct != colNextsct_end; ++colNextsct){
962 if(!SCT_Collection)
continue;
968 n_sct_hits[1] += SCT_Collection->
size();
971 n_sct_hits[0] += SCT_Collection->
size();
974 n_sct_hits[2] += SCT_Collection->
size();
985 positions_A[
gain].sort();
986 positions_C[
gain].sort();
991 unsigned int detector_a=(positions_A[
gain].front()).
detector;
995 if(
bcid<(*it_c).bcid)
continue;
996 if (
bcid==(*it_c).bcid) {
997 int deltatbins=(*it_c).position-(positions_A[
gain].front()).position;
998 deltat = deltatbins/64.0*25.0;
1010 if (abs(deltat) < 6.25)
m_sct_vs_pix_col[
gain]->Fill(n_sct_hits[0]+n_sct_hits[1]+n_sct_hits[2], n_pix_hits[0]+n_pix_hits[1]+n_pix_hits[2]);
1011 else m_sct_vs_pix_bkg[
gain]->Fill(n_sct_hits[0]+n_sct_hits[1]+n_sct_hits[2], n_pix_hits[0]+n_pix_hits[1]+n_pix_hits[2]);
1012 if (detector_a==(*it_c).detector) {
1025 positions_A[
gain].pop_front();
1035 for(
unsigned int bc_counter = 0; bc_counter < bc_readout; bc_counter++){
1036 double nROD0abortfraction = 100*((nROD0HitLG[bc_counter]*11)+nROD0HitHG[bc_counter])/36.0;
1037 double nROD1abortfraction = 100*((nROD1HitLG[bc_counter]*11)+nROD1HitHG[bc_counter])/36.0;
1038 if (nROD0abortfraction != 0 || nROD1abortfraction !=0) {
1039 double nabortfraction = (nROD0abortfraction+nROD1abortfraction)/2;
1043 if (nROD0BCID[bc_counter]==nROD1BCID[bc_counter]) {
1047 if (nROD0abortfraction != 0) {
1052 if (nROD1abortfraction != 0) {
1061 return StatusCode::SUCCESS;