16 bool sortByLayer(
const std::shared_ptr<PadOfflineData> &
p0,
const std::shared_ptr<PadOfflineData>&
p1) {
17 return p0->gasGapId()<
p1->gasGapId();
20 const std::vector<std::shared_ptr<PadOfflineData>> &pads,
21 const std::vector<size_t> &padIndices) :
22 m_pattern(
pattern), m_halfPadIndices(-999,-999), m_padIndices(padIndices),m_alreadyCombined(false){
30 std::ostringstream oss;
36 const std::vector<std::shared_ptr<PadOfflineData>> &
pads =
m_pads;
39 int l0(pad0->gasGapId()),
l1(pad1->gasGapId()),
l2(pad2->gasGapId());
47 EtaPhi posA(-999,-999), posB(-999,-999);
49 posA =
EtaPhi(pad0->padEtaId(), pad0->padPhiId());
50 posB =
EtaPhi(pad1->padEtaId(), pad1->padPhiId());
53 posA =
EtaPhi(pad0->padEtaId(), pad0->padPhiId());
54 posB =
EtaPhi(pad2->padEtaId(), pad2->padPhiId());
57 posA =
EtaPhi(pad1->padEtaId(), pad1->padPhiId());
58 posB =
EtaPhi(pad0->padEtaId(), pad0->padPhiId());
62 pos.ieta = ((posA.ieta==posB.
ieta) ? (posA.ieta * 2) : (posA.ieta * 2 + 1));
63 pos.iphi = ((posA.iphi==posB.
iphi) ? (posA.iphi * 2) : (posA.iphi * 2 + 1));
65 pos.ieta = pad0->padEtaId()+pad2->padEtaId() -1;
67 if(pad0->sectorType()==1 && pad0->moduleId()==1)
pos.ieta +=1;
68 if(pad0->sectorType()==0 && pad0->moduleId()!=1)
pos.ieta +=1;
73 const std::shared_ptr<PadOfflineData> &firstPad =
m_pads[0];
74 bool isEven = (firstPad->sectorType())==0;
82 if(
area(ROI)==0)
return false;
88 auto vector = ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<float>>(ROIx,ROIy);
92 float TransitonSmall[7] ={2104,2243,3248,3445,4216,4411,ROILocalY};
93 float TransitonLarge[7] ={2144,2278,3294,3483,4406,4596,ROILocalY};
94 if(
m_pads[0]->multipletId()==2){
95 for(
int i= 0;
i<6;
i++){
96 TransitonSmall[
i] = TransitonSmall[
i]*Zratio.second;
97 TransitonLarge[
i] = TransitonLarge[
i]*Zratio.first;
102 std::sort(TransitonSmall, TransitonSmall + 7);
103 if(TransitonSmall[1]==ROILocalY || TransitonSmall[3]==ROILocalY || TransitonSmall[5]==ROILocalY)
return true;
106 std::sort(TransitonLarge, TransitonLarge + 7);
107 if(TransitonLarge[1]==ROILocalY || TransitonLarge[3]==ROILocalY || TransitonLarge[5]==ROILocalY)
return true;
114 size_t nPads(
pads.size());
115 bool haveEnoughPads(nPads>2);
116 if(not haveEnoughPads){
117 std::cerr<<
"SingleWedgePadTrigger::halfPadCoordinates: need at least 3 pads"<<std::endl;
119 assert(haveEnoughPads);
120 const std::shared_ptr<PadOfflineData> &pad0=
pads[0], &pad1=
pads[1], &pad2=
pads[2];
121 int l0(pad0->gasGapId()),
l1(pad1->gasGapId()),
l2(pad2->gasGapId());
126 bool validLayerCombination(hasL1L2 || hasL1L4 || hasL2L3);
129 assert(validLayerCombination);
130 (void) validLayerCombination;
134 std::vector<Polygon> projected_pads;
139 constexpr std::array<int,4> vertexordering={0,1,3,2};
141 float Zproj=
pads[0]->m_cornerXyz[1][2];
142 for(
const auto& pad :
pads){
144 for(
unsigned int i=0;
i<4;
i++){
145 int icorner=vertexordering[
i];
146 float x=pad->m_cornerXyz[icorner][0];
147 float y=pad->m_cornerXyz[icorner][1];
151 projected_pads.push_back(
Project(padPolygon,pad->m_cornerXyz[2][2],Zproj));
163 bool mismatchEta(outer.
ieta < inner.
ieta - 4 || outer.
ieta > inner.
ieta + 4);
164 bool mismatchPhi(outer.
iphi < inner.
iphi - 4 || outer.
iphi > inner.
iphi + 4);
165 bool mismatch(mismatchEta || mismatchPhi);
173 (samePhi ? inner.
iphi * 2 : inner.
iphi * 2 + 1));