28 const int region(endc == 0 ? -1 : 1);
32 std::vector<ME0TriggerDigi> trigV;
33 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
35 LogTrace(
"L1ME0Trigger") <<
"ME0TriggerPseudoBuilder id " << detid <<
" ME0 segment " << *digiIt
36 <<
" to be converted into trigger digi\n";
39 trigV.push_back(
trig);
41 LogTrace(
"L1ME0Trigger") <<
" ME0trigger " <<
trig <<
"\n";
43 LogTrace(
"L1ME0Trigger") <<
" ME0trigger is not valid. Conversion failed \n";
47 LogTrace(
"L1ME0Trigger") <<
"ME0TriggerPseudoBuilder got results in " << detid << std::endl
48 <<
"Put " << trigV.size() <<
" Trigger digi" << ((trigV.size() > 1) ?
"s " :
" ")
50 oc_trig.put(std::make_pair(trigV.begin(), trigV.end()), detid);
60 int chamberid = detid.chamber() % 2;
64 int sign_time = (
time > 0) ? 1 : -1;
66 std::vector<int> rolls;
68 if (
std::find(rolls.begin(), rolls.end(), rechit.me0Id().roll()) == rolls.end())
69 rolls.push_back(rechit.me0Id().roll());
71 if (rolls.size() > 2
or rolls.empty())
72 LogTrace(
"L1ME0Trigger") <<
" ME0 segment is crossing " << rolls.size() <<
" roll !!! \n";
77 LogTrace(
"L1ME0Trigger") <<
" ME0 segment has wrong roll number " << rolls[0] <<
" which should be >= 1 \n !!!";
79 int partition = (rolls[0] - 1) << 1;
80 if (rolls.size() == 2 and rolls[0] > rolls[1])
81 partition = partition - 1;
82 else if (rolls.size() == 2 and rolls[0] < rolls[1])
83 partition = partition + 1;
85 if (partition < 0 or partition >= 2 * totRolls) {
86 LogTrace(
"L1ME0Trigger") <<
" ME0 segment rolls size of all hits " << rolls.size() <<
" rolls[0] " << rolls[0]
87 <<
" rolls.back() " << rolls.back() <<
" and ME0 trigger roll is " << partition
88 <<
" max expected " << 2 * totRolls - 1 <<
"\n";
96 float strippitch = etapart->
localPitch(segment_lp);
98 int totstrip = etapart->
nstrips();
99 int istrip = static_cast<int>(
strip);
100 int phiposition = istrip;
101 if (phiposition > totstrip)
102 LogTrace(
"L1ME0Trigger") <<
" ME0 segment strip number is " << phiposition <<
" larger than nstrip " << totstrip
104 float phi_resolution = 0.5;
105 int phiposition2 = (static_cast<int>((
strip - phiposition) / phi_resolution) & 1);
106 phiposition = (phiposition << 1) | phiposition2;
109 float centreOfStrip = istrip + 0.25 + phiposition2 * 0.5;
112 float strippitch_rad = strippitch /
gp.perp();
114 int idphi = static_cast<int>(fabs(dphi) / (strippitch_rad *
dphiresolution_));
115 const int max_idphi = 512;
116 if (idphi >= max_idphi) {
117 LogTrace(
"L1ME0Trigger") <<
" ME0 segment dphi " << dphi <<
" and int type: " << idphi
118 <<
" larger than max allowed: " << max_idphi <<
" !!! \n";
119 idphi = max_idphi - 1;
123 int bend = (dphi > 0.0) ? 0 : 1;
125 LogTrace(
"L1ME0Trigger") <<
" ME0trigger in conversion function:\n"
126 <<
"\t chamber(1-18) " << detid.chamber() <<
" chamber id " << chamberid <<
" \n"
127 <<
"\t rolls size of all hits " << rolls.size() <<
" rolls[0] " << rolls[0]
128 <<
" rolls.back() " << rolls.back() <<
" roll " << partition <<
" \n"
129 <<
"\t nRechits " << nrechits <<
" quality " <<
quality <<
" \n"
130 <<
"\t strip(float) " <<
strip <<
" (int) " << istrip <<
" phiposition " << phiposition
131 <<
" resolution (in term of strip) " << phi_resolution <<
" \n"
132 <<
"\t deltaphi(float) " << dphi <<
" (int) " << idphi <<
" resolution "
134 <<
"\t global point eta " <<
gp.eta() <<
" phi " <<
gp.phi() <<
" trigger digi eta "
135 << gp_digi.
eta() <<
" phi " << gp_digi.
phi() <<
" \n"
136 <<
"\t time (ns, float) " <<
time <<
" BX " <<
BX <<
" \n";
144 LogTrace(
"L1ME0Trigger") <<
"dumpt all ME0 Segments" << std::endl;
145 for (
auto iC = segments.id_begin(); iC != segments.id_end(); ++iC) {
146 auto ch_segs = segments.get(*iC);
147 for (
auto iS = ch_segs.first; iS != ch_segs.second; ++iS) {
149 LogTrace(
"L1ME0Trigger") <<
"ME0Detid " << iS->me0DetId() <<
" segment " << *iS <<
" eta " <<
gp.eta() <<
" phi "
150 <<
gp.phi() << std::endl;
152 LogTrace(
"L1ME0Trigger") <<
"\t has " <<
recHits.size() <<
" me0 rechits" << std::endl;
154 const ME0RecHit* me0rh(dynamic_cast<const ME0RecHit*>(rh));
155 LogTrace(
"L1ME0Trigger") <<
"\t detid " << me0rh->
me0Id() <<
" rechit " << *me0rh << std::endl;