33 const int region(endc == 0 ? -1 : 1);
36 const auto& drange = me0Segments->get(detid);
37 std::vector<ME0TriggerDigi> trigV;
38 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
39 if (
info_ > 1 )
LogTrace(
"L1ME0Trigger") <<
"ME0TriggerPseudoBuilder id "<< detid
40 <<
" ME0 segment "<< *digiIt <<
" to be converted into trigger digi\n";
42 if (trig.
isValid()) trigV.push_back(trig);
44 else if (
info_ > 1)
LogTrace(
"L1ME0Trigger") <<
" ME0trigger is not valid. Conversion failed \n";
49 <<
"ME0TriggerPseudoBuilder got results in " <<detid
51 <<
"Put " << trigV.size() <<
" Trigger digi" 52 << ((trigV.size() > 1) ?
"s " :
" ") <<
"in collection\n";
53 oc_trig.put(std::make_pair(trigV.begin(),trigV.end()), detid);
64 int chamberid = detid.chamber()%2;
68 int sign_time = (time > 0) ? 1 : -1;
70 std::vector<int> rolls;
72 if (
std::find(rolls.begin(), rolls.end(), rechit.me0Id().roll()) == rolls.end())
73 rolls.push_back(rechit.me0Id().roll());
75 if (rolls.size() > 2
or rolls.empty())
LogTrace(
"L1ME0Trigger") <<
" ME0 segment is crossing "<< rolls.size() <<
" roll !!! \n";
76 assert( rolls.size() <=2 );
78 if (rolls[0] < 1)
LogTrace(
"L1ME0Trigger") <<
" ME0 segment has wrong roll number "<< rolls[0] <<
" which should be >= 1 \n !!!";
79 assert(rolls[0] >= 1);
80 int partition = (rolls[0] -1 )<< 1;
81 if (rolls.size() == 2 and rolls[0] > rolls[1]) partition = partition-1;
82 else if (rolls.size() == 2 and rolls[0] < rolls[1]) partition = partition+1;
84 if (partition < 0 or partition >= 2*totRolls){
85 LogTrace(
"L1ME0Trigger") <<
" ME0 segment rolls size of all hits "<< rolls.size() <<
" rolls[0] "<< rolls[0] <<
" rolls.back() "<< rolls.back()
86 <<
" and ME0 trigger roll is "<< partition <<
" max expected "<< 2*totRolls-1 <<
"\n";
93 int totstrip = etapart->
nstrips();
94 int istrip =
static_cast<int>(
strip);
95 int phiposition = istrip;
96 if (phiposition > totstrip)
LogTrace(
"L1ME0Trigger")<<
" ME0 segment strip number is "<< phiposition <<
" larger than nstrip "<< totstrip <<
" !!! \n";
97 float phi_resolution = 0.5;
98 int phiposition2 = (
static_cast<int>((strip - phiposition)/phi_resolution) & 1);
99 phiposition = (phiposition << 1) | phiposition2;
104 float centreOfStrip = istrip + 0.25 +phiposition2*0.5;
109 const int max_idphi = 512;
110 if (idphi >= max_idphi){
111 LogTrace(
"L1ME0Trigger")<<
" ME0 segment dphi "<< dphi <<
" and int type: "<< idphi <<
" larger than max allowed: "<< max_idphi <<
" !!! \n";
112 idphi = max_idphi -1;
116 int bend = (dphi > 0.0) ? 0 : 1;
117 if (
info_ > 2)
LogTrace(
"L1ME0Trigger") <<
" ME0trigger in conversion function:\n" 118 <<
"\t chamber(1-18) "<< detid.chamber() <<
" chamber id "<< chamberid <<
" \n" 119 <<
"\t rolls size of all hits "<< rolls.size() <<
" rolls[0] "<< rolls[0] <<
" rolls.back() "<< rolls.back() <<
" roll "<< partition <<
" \n" 120 <<
"\t nRechits "<< nrechits <<
" quality "<< quality <<
" \n" 121 <<
"\t strip(float) "<< strip <<
" (int) "<< istrip<<
" phiposition "<< phiposition <<
" resolution (in term of strip) "<< phi_resolution <<
" \n" 122 <<
"\t deltaphi(float) "<< dphi <<
" (int) "<< idphi <<
" resolution "<< strippitch*
dphiresolution_ <<
" bend "<< bend <<
" \n" 123 <<
"\t global point eta "<< gp.
eta() <<
" phi "<< gp.
phi() <<
" trigger digi eta "<< gp_digi.
eta() <<
" phi "<< gp_digi.
phi() <<
" \n" 124 <<
"\t time (ns, float) "<< time <<
" BX "<< BX <<
" \n";
136 LogTrace(
"L1ME0Trigger")<<
"dumpt all ME0 Segments" << std::endl;
137 for(
auto iC = segments.id_begin(); iC != segments.id_end(); ++iC){
138 auto ch_segs = segments.get(*iC);
139 for(
auto iS = ch_segs.first; iS != ch_segs.second; ++iS){
141 LogTrace(
"L1ME0Trigger") <<
"ME0Detid "<< iS->me0DetId()<<
" segment "<< *iS <<
" eta "<< gp.
eta() <<
" phi "<< gp.
phi()<< std::endl;
142 auto recHits(iS->recHits());
143 LogTrace(
"L1ME0Trigger") <<
"\t has " << recHits.size() <<
" me0 rechits"<< std::endl;
144 for (
auto& rh: recHits) {
145 const ME0RecHit* me0rh(dynamic_cast<const ME0RecHit*>(rh));
146 LogTrace(
"L1ME0Trigger") <<
"\t detid "<< me0rh->
me0Id()<<
" rechit "<< *me0rh << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
float localPitch(const LocalPoint &lp) const
const std::vector< ME0RecHit > & specificRecHits() const
~ME0TriggerPseudoBuilder()
const ME0Layer * layer(ME0DetId id) const
Return the layer corresponding to the given id.
ME0DetId me0DetId() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void build(const ME0SegmentCollection *me0segments, ME0TriggerDigiCollection &oc_trig)
Geom::Phi< T > phi() const
LocalPoint centreOfStrip(int strip) const
ME0TriggerDigi segmentConversion(const ME0Segment segment)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
float strip(const LocalPoint &lp) const
static const int ME0TriggerCentralBX
edm::ParameterSet config_
float computeDeltaPhi(const LocalPoint &position, const LocalVector &direction) const
void dumpAllME0Segments(const ME0SegmentCollection &segments) 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
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
LocalVector localDirection() const override
Local direction.
int nstrips() const
Return the chamber this roll belongs to.
void setStrip(unsigned int s)
set strip
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return the eta partition corresponding to the given id.
LocalPoint localPosition() const override
ME0TriggerPseudoBuilder(const edm::ParameterSet &)
int nEtaPartitions() const
Retunr numbers of eta partitions.
const GeomDet * idToDet(DetId) const override
ME0DetId me0Id() const
Return the gemId.
const ME0Geometry * me0_g
static const unsigned int ME0KeyLayer
bool isValid() const
is valid?