5 #include "GaudiKernel/ConcurrencyFlags.h"
23 using STRIP_MAP=std::map < Identifier,std::vector<StripHits> >;
30 declareInterface<NSWL1::IStripTdsTool>(
this);
43 return StatusCode::SUCCESS;
47 ATH_MSG_DEBUG(
"gather_strip_data: start gathering all strip htis");
49 std::vector<std::unique_ptr<StripData>> strip_cache;
53 for (
unsigned int i=0;
i< strip_cache.size();
i++) {
55 strips.push_back(std::move(strip_cache.at(
i)));
58 ATH_MSG_DEBUG(
"Delivered n. " << strips.size() <<
" STRIP hits." );
59 return StatusCode::SUCCESS;
65 ATH_MSG_DEBUG(
"fill_strip_cache: start filling the cache for STRIP hits" );
70 ATH_MSG_WARNING(
"could not retrieve the sTGC SDO container: it will not be possible to associate the MC truth");
76 ATH_MSG_ERROR(
"could not retrieve the sTGC Digit container: cannot return the STRIP hits");
83 int strip_hit_number = 0;
84 for(;
it!=it_e; ++
it) {
100 const auto& stripSurface=rdoEl->
surface(Id);
101 stripSurface.
localToGlobal(strip_lpos, strip_gpos, strip_gpos);
104 int stationEta =
m_idHelperSvc->stgcIdHelper().stationEta(Id);
105 int stationPhi =
m_idHelperSvc->stgcIdHelper().stationPhi(Id);
109 int bctag =
digit->bcTag();
115 ATH_MSG_DEBUG(
"sTGC Strip hit " << strip_hit_number <<
": Station Name [" << stName <<
"]"
116 <<
" Station Eta [" << stationEta <<
"]"
117 <<
" Station Phi [" << stationPhi <<
"]"
118 <<
" Wedge [" << wedge <<
"]"
119 <<
" Layer [" <<
layer <<
"]"
122 <<
" Strip Eta [" << strip_eta <<
"]"
123 <<
" Strip Phi [" << strip_phi <<
"]"
124 <<
" Strip bcTAg [" << bctag <<
"]");
127 int trigger_sector = (isSmall)? stationPhi*2 : stationPhi*2-1;
128 int cache_index = (stationEta>0)? trigger_sector + 16 : trigger_sector;
129 ATH_MSG_DEBUG(
"sTGC Strip hit " << strip_hit_number <<
": Trigger Sector [" << trigger_sector <<
"]" <<
" Cache Index [" << cache_index <<
"]" );
132 auto strip=std::make_unique<StripOfflineData>(Id,&
m_idHelperSvc->stgcIdHelper(),
digit);
133 strip->set_locX(strip_lpos.x());
134 strip->set_locY(strip_lpos.y());
135 int sideid= (stationEta>0) ? 1 : 0;
136 int sectortype= (isSmall==1) ? 0 : 1;
137 int sectorid=stationPhi;
138 int moduleid=std::abs(stationEta);
141 strip->setSideId(sideid);
142 strip->setSectorType(sectortype);
143 strip->setSectorId(sectorid);
144 strip->setModuleId(moduleid);
145 strip->setWedgeId(wedgeid);
146 strip->setLayerId(layerid);
147 strip->set_globX(strip_gpos.x());
148 strip->set_globY(strip_gpos.y());
149 strip->set_globZ(strip_gpos.z());
152 bool read_strip=
readStrip(strip.get(),padTriggers);
153 if (read_strip && (strip->bandId() ==-1 || strip->phiId()==-1 ) ) {
155 <<
"wedge:" << strip->wedge() <<
"\n"
156 <<
"layer:"<< strip->layer() <<
"\n"
157 <<
"loc_x:"<< strip->locX()<<
"\n");
161 strip->set_readStrip(read_strip);
162 strip_cache.push_back(std::move(strip));
166 return StatusCode::SUCCESS;
172 if (strip->bandId() !=-1) {
173 ATH_MSG_DEBUG(
"StripTdsOfflineTool:ReadStrip: BandId already set\n" <<
"moduleID:" << strip->moduleId() +1 <<
"\n"
174 <<
"sectiorID:" << strip->sectorId() + 1 <<
"\n" <<
"layer:" << strip->wedge() <<
"\n");
176 if (strip->phiId() !=-1) {
177 ATH_MSG_DEBUG(
"StripTdsOfflineTool:ReadStrip: PhiId already set\n" <<
"moduleID:"<< strip->moduleId() +1 <<
"\n"
178 <<
"sectiorID:" << strip->sectorId() + 1 <<
"\n" <<
"layer:" << strip->wedge() <<
"\n");
180 for(
const std::unique_ptr<PadTrigger>& trig :padTriggers){
182 for(
const std::shared_ptr<PadData>& pad : trig->m_pads){
183 if (strip->sideId()!=pad->sideId() ||
184 strip->isSmall()==pad->sectorType() ||
185 strip->sectorId()!=pad->sectorId() ||
186 std::abs(strip->etaCenter() )> trig->etaMax() ||
187 std::abs(strip->etaCenter() ) < trig->etaMin() ||
188 strip->layer()!=pad->gasGapId()
191 strip->setBandId(trig->bandId());
192 strip->setPhiId(trig->phiId());