|
|
Go to the documentation of this file.
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;
void build(const ME0SegmentCollection *me0segments, ME0TriggerDigiCollection &oc_trig)
static const int ME0TriggerCentralBX
ME0TriggerDigi segmentConversion(const ME0Segment segment)
const std::vector< ME0RecHit > & specificRecHits() const
static const unsigned int ME0KeyLayer
const GeomDet * idToDet(DetId) const override
edm::ParameterSet config_
T getUntrackedParameter(std::string const &, T const &) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return the eta partition corresponding to the given id.
const uint32_t *__restrict__ Quality * quality
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
const Plane & surface() const
The nominal surface of the GeomDet.
~ME0TriggerPseudoBuilder()
LocalPoint centreOfStrip(int strip) const
LocalVector localDirection() const override
Local direction.
const ME0Layer * layer(ME0DetId id) const
Return the layer corresponding to the given id.
void dumpAllME0Segments(const ME0SegmentCollection &segments) const
int nstrips() const
Return the chamber this roll belongs to.
const ME0Geometry * me0_g
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
float localPitch(const LocalPoint &lp) const
ME0DetId me0DetId() const
ME0DetId me0Id() const
Return the gemId.
LocalPoint localPosition() const override
int nEtaPartitions() const
Retunr numbers of eta partitions.
double bend(double r, double rinv, double stripPitch)
LocalPoint toLocal(const GlobalPoint &gp) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
float strip(const LocalPoint &lp) const
ME0TriggerPseudoBuilder(const edm::ParameterSet &)
Geom::Phi< T > phi() const