28 const int region(endc == 0 ? -1 : 1);
33 std::vector<ME0TriggerDigi> trigV;
34 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
36 LogTrace(
"L1ME0Trigger") <<
"GE0TriggerPseudoBuilder id " << detid <<
" ME0 segment " << *digiIt
37 <<
" to be converted into trigger digi\n";
40 trigV.push_back(
trig);
42 LogTrace(
"L1ME0Trigger") <<
" ME0trigger " <<
trig <<
"\n";
44 LogTrace(
"L1ME0Trigger") <<
" ME0trigger is not valid. Conversion failed \n";
48 LogTrace(
"L1ME0Trigger") <<
"GE0TriggerPseudoBuilder got results in " << detid << std::endl
49 <<
"Put " << trigV.size() <<
" Trigger digi" << ((trigV.size() > 1) ?
"s " :
" ")
51 oc_trig.
put(std::make_pair(trigV.begin(), trigV.end()), detid);
61 int chamberid = detid.superChamberId() % 2;
66 std::vector<int> rolls;
68 if (
std::find(rolls.begin(), rolls.end(), rechit.gemId().roll()) == rolls.end())
69 rolls.push_back(rechit.gemId().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 !!!";
81 if (rolls.size() == 2 and rolls[0] > rolls[1])
83 else if (rolls.size() == 2 and rolls[0] < rolls[1])
86 if (partition < 0 or partition >= 2 * totRolls) {
87 LogTrace(
"L1ME0Trigger") <<
" ME0 segment rolls size of all hits " << rolls.size() <<
" rolls[0] " << rolls[0]
88 <<
" rolls.back() " << rolls.back() <<
" and ME0 trigger roll is " <<
partition 89 <<
" max expected " << 2 * totRolls - 1 <<
"\n";
97 float strippitch = etapart->
localPitch(segment_lp);
99 int totstrip = etapart->
nstrips();
100 int istrip =
static_cast<int>(
strip);
101 int phiposition = istrip;
102 if (phiposition > totstrip)
103 LogTrace(
"L1ME0Trigger") <<
" ME0 segment strip number is " << phiposition <<
" larger than nstrip " << totstrip
106 int phiposition2 = (
static_cast<int>((
strip - phiposition) / phi_resolution) & 1);
107 phiposition = (phiposition << 1) | phiposition2;
110 float centreOfStrip = istrip + 0.25 + phiposition2 * 0.5;
113 float strippitch_rad = strippitch /
gp.perp();
115 int idphi =
static_cast<int>(fabs(dphi) / (strippitch_rad *
dphiresolution_));
116 const int max_idphi = 512;
117 if (idphi >= max_idphi) {
118 LogTrace(
"L1ME0Trigger") <<
" ME0 segment dphi " << dphi <<
" and int type: " << idphi
119 <<
" larger than max allowed: " << max_idphi <<
" !!! \n";
120 idphi = max_idphi - 1;
125 int bend = (dphi > 0.0) ? 0 : 1;
127 LogTrace(
"L1ME0Trigger") <<
" ME0trigger in conversion function:\n" 128 <<
"\t chamber(1-18) " << detid.chamber() <<
" chamber id " << chamberid <<
" \n" 129 <<
"\t rolls size of all hits " << rolls.size() <<
" rolls[0] " << rolls[0]
130 <<
" rolls.back() " << rolls.back() <<
" roll " <<
partition <<
" \n" 131 <<
"\t nRechits " << nrechits <<
" quality " <<
quality <<
" \n" 132 <<
"\t strip(float) " <<
strip <<
" (int) " << istrip <<
" phiposition " << phiposition
133 <<
" resolution (in term of strip) " << phi_resolution <<
" \n" 134 <<
"\t deltaphi(float) " << dphi <<
" (int) " << idphi <<
" resolution " 136 <<
"\t global point eta " <<
gp.eta() <<
" phi " <<
gp.phi() <<
" trigger digi eta " 137 << gp_digi.
eta() <<
" phi " << gp_digi.
phi() <<
" \n" 149 LogTrace(
"L1GE0Trigger") <<
"dumpt all ME0 Segments" << std::endl;
150 for (
auto iC = segments.id_begin(); iC != segments.id_end(); ++iC) {
151 auto ch_segs = segments.get(*iC);
152 for (
auto iS = ch_segs.first; iS != ch_segs.second; ++iS) {
153 if (iS->gemDetId().station() != 0)
156 LogTrace(
"L1ME0Trigger") <<
"ME0Detid " << iS->gemDetId() <<
" segment " << *iS <<
" eta " <<
gp.eta() <<
" phi " 157 <<
gp.phi() << std::endl;
159 LogTrace(
"L1GE0Trigger") <<
"\t has " <<
recHits.size() <<
" me0 rechits" << std::endl;
161 const GEMRecHit* me0rh(dynamic_cast<const GEMRecHit*>(rh));
162 LogTrace(
"L1GEMTrigger") <<
"\t detid " << me0rh->
gemId() <<
" rechit " << *me0rh << std::endl;
LocalPoint localPosition() const override
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return the eta partition corresponding to the given id.
edm::ParameterSet config_
LocalVector localDirection() const override
Local direction.
Geom::Phi< T > phi() const
const GeomDet * idToDet(DetId) const override
int nEtaPartitions() const
Retunr numbers of eta partitions.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
LocalPoint toLocal(const GlobalPoint &gp) const
static const int ME0TriggerCentralBX
T getUntrackedParameter(std::string const &, T const &) const
~GE0TriggerPseudoBuilder()
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
ME0TriggerDigi segmentConversion(const GEMSegment segment)
const std::vector< GEMRecHit > & specificRecHits() const
GE0TriggerPseudoBuilder(const edm::ParameterSet &)
void build(const GEMSegmentCollection &me0segments, GE0TriggerDigiCollection &oc_trig)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const GEMGeometry * me0_g
const Plane & surface() const
The nominal surface of the GeomDet.
GEMDetId gemId() const
Return the gemId.
GEMDetId gemDetId() const
void dumpAllME0Segments(const GEMSegmentCollection &segments) const
static const unsigned int ME0KeyLayer
const GEMSuperChamber * superChamber(GEMDetId id) const
void put(Range range, const IndexType &index)
insert a range of digis for a given DetUnit
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...