Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
NSWL1::StripClusterTool Class Referenceabstract

interface for the StripTDS tools More...

#include <StripClusterTool.h>

Inheritance diagram for NSWL1::StripClusterTool:
Collaboration diagram for NSWL1::StripClusterTool:

Public Member Functions

 StripClusterTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~StripClusterTool ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode cluster_strip_data (const EventContext &ctx, std::vector< std::unique_ptr< StripData >> &strips, std::vector< std::unique_ptr< StripClusterData >> &clusters) const override
 
virtual StatusCode cluster_strip_data (const EventContext &ctx, std::vector< std::unique_ptr< StripData >> &strips, std::vector< std::unique_ptr< StripClusterData > > &clusters) const =0
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode fill_strip_validation_id (const EventContext &ctx, std::vector< std::unique_ptr< StripClusterData >> &clusters, std::vector< std::shared_ptr< std::vector< std::unique_ptr< StripData > >> > &cluster_cache) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
 Athena/Gaudi incident Service. More...
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_detManagerKey {this, "MuonManagerKey", "MuonDetectorManager"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
Gaudi::Property< bool > m_isMC {this, "IsMC", true, "This is MC"}
 
SG::ReadHandleKey< MuonSimDataCollectionm_sTgcSdoContainerKey {this,"sTGC_SdoContainerName", "sTGC_SDO", "the name of the sTGC SDO container"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

interface for the StripTDS tools

This class implements the Strip Clustering offline simulation. It loops over the hits, readout from the StripTDSOffLineTool

Author
Jacob Searcy jsear.nosp@m.cy@c.nosp@m.ern.c.nosp@m.h

Definition at line 52 of file StripClusterTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ StripClusterTool()

NSWL1::StripClusterTool::StripClusterTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 11 of file StripClusterTool.cxx.

11  :
13  {
14  declareInterface<NSWL1::IStripClusterTool>(this);
15  }

◆ ~StripClusterTool()

virtual NSWL1::StripClusterTool::~StripClusterTool ( )
virtualdefault

Member Function Documentation

◆ cluster_strip_data() [1/2]

virtual StatusCode NSWL1::IStripClusterTool::cluster_strip_data ( const EventContext &  ctx,
std::vector< std::unique_ptr< StripData >> &  strips,
std::vector< std::unique_ptr< StripClusterData > > &  clusters 
) const
pure virtualinherited

◆ cluster_strip_data() [2/2]

StatusCode NSWL1::StripClusterTool::cluster_strip_data ( const EventContext &  ctx,
std::vector< std::unique_ptr< StripData >> &  strips,
std::vector< std::unique_ptr< StripClusterData >> &  clusters 
) const
overridevirtual

Definition at line 173 of file StripClusterTool.cxx.

173  {
174 
175  if(strips.empty()){
176  ATH_MSG_WARNING("Received 0 strip hits... Skip event");
177  return StatusCode::SUCCESS;
178  }
179 
180  std::map<uint32_t, std::vector<std::unique_ptr<StripData>> > stripMap;
181  // Filter by layer:
182  for (auto& st : strips) {
183  // sideId [0, 1]
184  auto sideId = st->sideId();
185  // sectorType: small==0, large==1
186  auto sectorType = st->sectorType();
187  // sectorId [1,8]
188  auto sectorId = st->sectorId();
189  // etaId [1,3]
190  auto etaId = st->moduleId();
191  // wedgeId [1,2]
192  auto wedgeId = st->wedge();
193  // layer [1,4]
194  auto layerId = st->layer();
195 
196  // add 1 as the first placeholder, hence cache_hash always has 7 digits
197  std::string id_str = std::to_string(1)+std::to_string(sideId)+std::to_string(sectorType)+std::to_string(sectorId)+std::to_string(etaId)+std::to_string(wedgeId)+std::to_string(layerId);
198  const uint32_t cache_hash = atoi(id_str.c_str());
199 
200  auto it = stripMap.find(cache_hash);
201  if (it != stripMap.end()){
202  it->second.push_back(std::move(st));
203  }
204  else{
205  stripMap[cache_hash].push_back(std::move(st));
206  }
207 
208  }
209 
210  std::vector< std::shared_ptr<std::vector<std::unique_ptr<StripData> >> > cluster_cache;
211  for (auto &item : stripMap) {
212  std::vector<std::unique_ptr<StripData>>& stripList = item.second;
213 
214  //S.I sort strip w.r.t channelId in ascending order
215  std::sort(stripList.begin(), stripList.end(), [](const auto& s1,const auto& s2) { return s1->channelId()<s2->channelId(); });
216 
217  auto hit=stripList.begin();
218  ATH_MSG_DEBUG("Cluster Hits :" << (*hit)->channelId() << " " << m_idHelperSvc->stgcIdHelper().gasGap( (*hit)->Identity())
219  << " " << (*hit)->moduleId() << " " << (*hit)->sectorId() << " " << (*hit)->wedge() << " " << (*hit)->sideId() );
220  int first_ch=(*hit)->channelId();//channel id of the first strip
221  int prev_ch=-1;
222 
223  auto cr_cluster=std::make_shared< std::vector<std::unique_ptr<StripData>> >();
224 
225  for(auto& this_hit : stripList){
226  if(!(this_hit)->readStrip() ) continue;
227  if( ((this_hit)->bandId()==-1 || this_hit->phiId()==-1) ){
228  ATH_MSG_WARNING("Read Strip without BandId :" << (this_hit)->channelId() << " " << m_idHelperSvc->stgcIdHelper().gasGap( (this_hit)->Identity())
229  << " " << (this_hit)->moduleId() << " " << (this_hit)->sectorId() << " " << (this_hit)->wedge() << " " << (this_hit)->sideId() );
230  continue;
231  }
232 
233  if (prev_ch==-1){//for the first time...
234  prev_ch = first_ch;
235  cr_cluster->push_back(std::move(this_hit));
236  continue;
237  }
238 
239  int this_ch=(this_hit)->channelId();
240  if ( (this_ch < prev_ch)) {
241  ATH_MSG_ERROR("Hits Ordered incorrectly!!!" );
242  return StatusCode::FAILURE;
243  }
244 
245  if (this_ch == prev_ch || this_ch == prev_ch+1) cr_cluster->push_back(std::move(this_hit)); // form cluster with adjacent +-1 strips
246  else {
247  cluster_cache.push_back(std::move(cr_cluster)); //put the current cluster into the clusters buffer
248  cr_cluster=std::make_shared<std::vector<std::unique_ptr<StripData>>>(); //create a new empty cluster and assign this hit as the first hit
249  cr_cluster->push_back(std::move(this_hit));
250  }
251 
252  prev_ch=this_ch;
253  }
254 
255  if(!cr_cluster->empty()) cluster_cache.push_back(std::move(cr_cluster)); //don't forget the last cluster in the loop
256  }
257 
258  ATH_MSG_DEBUG("Found :" << cluster_cache.size() << " clusters");
259  ATH_CHECK(fill_strip_validation_id(ctx, clusters, cluster_cache));
260  cluster_cache.clear();
261 
262  return StatusCode::SUCCESS;
263  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fill_strip_validation_id()

StatusCode NSWL1::StripClusterTool::fill_strip_validation_id ( const EventContext &  ctx,
std::vector< std::unique_ptr< StripClusterData >> &  clusters,
std::vector< std::shared_ptr< std::vector< std::unique_ptr< StripData > >> > &  cluster_cache 
) const
private

Definition at line 28 of file StripClusterTool.cxx.

30  {
32  ATH_MSG_DEBUG("Cluster cache received " << cluster_cache.size());
33 
34  bool first_strip=true;
35  for(const auto &this_cl : cluster_cache){
36  float x_pos=0;
37  float y_pos=0;
38  float z_pos=0;
39 
40  float x_lpos=0;
41  float y_lpos=0;
42  float z_lpos=0;
43 
44  int charge=0;
45  int n_strip=0;
46 
47  first_strip=true;
48  float locx=-999999;
49  float locy=-999999;
50  if (this_cl->empty()){
51  ATH_MSG_WARNING("Zero size cluster!!");
52  continue;
53  }
54 
55  const MuonSimDataCollection* sdo_container = nullptr;
56  if(m_isMC) {
57  SG::ReadHandle<MuonSimDataCollection> readMuonSimDataCollection( m_sTgcSdoContainerKey, ctx );
58  if( !readMuonSimDataCollection.isValid() ){
59  ATH_MSG_WARNING("could not retrieve the sTGC SDO container: it will not be possible to associate the MC truth");
60  return StatusCode::FAILURE;
61  }
62  sdo_container = readMuonSimDataCollection.cptr();
63  }
64 
65  for(const auto &strip_cl : *this_cl){
66  n_strip++;
67  ATH_MSG_DEBUG("Start strip" << n_strip);
68  // Save truth deposits associated with cluster should be the same on for the whole strip, so take the first one need to work on this logic
69  if(m_isMC && first_strip) {
70  first_strip=false;
71  Identifier Id = strip_cl->Identity();
72  const MuonGM::sTgcReadoutElement* rdoEl = detManager->getsTgcReadoutElement(Id);
73  auto it = sdo_container->find(Id);
74  if(it == sdo_container->end()) continue;
75  const MuonSimData strip_sdo = it->second;
76  std::vector<MuonSimData::Deposit> deposits;
77  strip_sdo.deposits(deposits);
78  //retrieve the info of the first associated hit, i.e. the fastest in time
79  if (deposits.size()!=1) ATH_MSG_WARNING("Multiple cluster hits for strip!");
80  if (deposits.empty()){
81  ATH_MSG_WARNING("Empty hit here");
82  continue;
83  }
84 
85  int truth_barcode = deposits[0].first.barcode();
86  double truth_localPosX = deposits[0].second.firstEntry();
87  double truth_localPosY = deposits[0].second.secondEntry();
88  Amg::Vector3D hit_gpos(0.,0.,0.);
89  Amg::Vector2D lpos(truth_localPosX,truth_localPosY);
90  rdoEl->surface(Id).localToGlobal(lpos, hit_gpos,hit_gpos);
91  double truth_globalPosX = hit_gpos.x();
92  double truth_globalPosY = hit_gpos.y();
93  double truth_globalPosZ = hit_gpos.z();
94  float truth_energy = strip_sdo.word();
95 
96  if(std::abs(locx-lpos.x())>.001 || std::abs(locy - lpos.y())>.001){
97  ATH_MSG_DEBUG("OLD locx " << locx << " new locx " << lpos.x() << " b " << int(locx!=lpos.x()));
98  ATH_MSG_DEBUG("OLD locy " << locy << " new locy " << lpos.y() << " b " << int(locy!=lpos.y()));
99  ATH_MSG_DEBUG("Cluster hit, truth barcode = " << truth_barcode);
100  ATH_MSG_DEBUG("Cluster hit, truth globalPosX = " << truth_globalPosX
101  << ", truth globalPosY = " << truth_globalPosY
102  << ", truth globalPosZ = " << truth_globalPosZ
103  << ", truth enegy deposit = " << truth_energy);
104  ATH_MSG_DEBUG("Cluster hit, truth localPosX = " << lpos.x()
105  << ", truth localPosY = " << lpos.y()
106  << ", truth enegy deposit = " << truth_energy);
107  }
108  }
109 
110  float s_charge=strip_cl->strip_charge_6bit();
111  charge+=s_charge;
112  x_pos+=strip_cl->globX()*s_charge;
113  y_pos+=strip_cl->globY()*s_charge;
114  z_pos+=strip_cl->globZ()*s_charge;
115 
116  x_lpos+=(strip_cl->locX())*s_charge;
117  y_lpos+=(strip_cl->locY())*s_charge;
118  z_lpos+=(strip_cl->locZ())*s_charge;
119 
120 
121  ATH_MSG_DEBUG("Cluster ------------------------------------------" );
122  ATH_MSG_DEBUG("Cluster strip charge: " << s_charge);
123  ATH_MSG_DEBUG("Cluster strip loc X: " << strip_cl->locX());
124  ATH_MSG_DEBUG("Cluster strip loc Y: " << strip_cl->locY());
125  ATH_MSG_DEBUG("Cluster strip glob X: " << strip_cl->globX());
126  ATH_MSG_DEBUG("Cluster strip glob Y: " << strip_cl->globY());
127  ATH_MSG_DEBUG("Cluster strip glob Z: " << strip_cl->globZ());
128  ATH_MSG_DEBUG("Cluster strip locx dist: " << locx-strip_cl->locX());
129  ATH_MSG_DEBUG("Cluster strip charge o dist: " << s_charge/(locx-strip_cl->locX()));
130  ATH_MSG_DEBUG("Channel " << strip_cl->channelId());
131 
132  }//end of this_cl loop
133 
134  if (charge != 0){
135  if ( std::abs(x_pos/charge)<200. && std::abs(y_pos/charge)<200.){
136  ATH_MSG_WARNING("Cluster ------------------------------------------" );
137  ATH_MSG_WARNING("Cluster strip charge: " << charge );
138  ATH_MSG_WARNING("Cluster strip glob X: " << x_pos << x_pos/charge);
139  ATH_MSG_WARNING("Cluster strip glob Y: " << y_pos << y_pos/charge);
140  ATH_MSG_WARNING("Cluster strip glob Z: " << z_pos << z_pos/charge);
141  }
142  x_pos=x_pos/charge;
143  y_pos=y_pos/charge;
144  z_pos=z_pos/charge;
145  x_lpos=x_lpos/charge;
146  y_lpos=y_lpos/charge;
147  z_lpos=z_lpos/charge;
148  }
149  ATH_MSG_DEBUG("Cluster dump with X:" << x_pos << " Y: " << y_pos << " Z: " << z_pos << " cluster charge: " << charge);
150  ATH_MSG_DEBUG("Cluster dump with lX:" << x_lpos << " lY: " << y_lpos << " lZ: " << z_lpos << " cluster charge: " << charge);
151 
152  auto stripClOfflData=std::make_unique<StripClusterOfflineData>(
153  this_cl->at(0)->bandId(),
154  this_cl->at(0)->trig_BCID(),
155  this_cl->at(0)->sideId(),
156  this_cl->at(0)->phiId(),
157  this_cl->at(0)->isSmall(),
158  this_cl->at(0)->moduleId(),
159  this_cl->at(0)->sectorId(),
160  this_cl->at(0)->wedge(),
161  this_cl->at(0)->layer(),
162  n_strip,
163  charge,
164  x_pos,
165  y_pos,
166  z_pos);
167  clusters.push_back(std::move(stripClOfflData));
168  }
169  return StatusCode::SUCCESS;
170  }

◆ initialize()

StatusCode NSWL1::StripClusterTool::initialize ( )
overridevirtual

Definition at line 17 of file StripClusterTool.cxx.

17  {
18  ATH_MSG_DEBUG( "initializing " << name() );
19 
21 
22  // retrieve the MuonDetectormanager
24  ATH_CHECK(m_idHelperSvc.retrieve());
25  return StatusCode::SUCCESS;
26  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& NSWL1::IStripClusterTool::interfaceID ( )
inlinestaticinherited

Definition at line 41 of file IStripClusterTool.h.

41  {
42  static const InterfaceID IID_IStripClusterTool("NSWL1::IStripClusterTool", 1 ,0);
43  return IID_IStripClusterTool;
44  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> NSWL1::StripClusterTool::m_detManagerKey {this, "MuonManagerKey", "MuonDetectorManager"}
private

Definition at line 70 of file StripClusterTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> NSWL1::StripClusterTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 71 of file StripClusterTool.h.

◆ m_incidentSvc

ServiceHandle< IIncidentSvc > NSWL1::StripClusterTool::m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
private

Athena/Gaudi incident Service.

Definition at line 69 of file StripClusterTool.h.

◆ m_isMC

Gaudi::Property<bool> NSWL1::StripClusterTool::m_isMC {this, "IsMC", true, "This is MC"}
private

Definition at line 73 of file StripClusterTool.h.

◆ m_sTgcSdoContainerKey

SG::ReadHandleKey<MuonSimDataCollection> NSWL1::StripClusterTool::m_sTgcSdoContainerKey {this,"sTGC_SdoContainerName", "sTGC_SDO", "the name of the sTGC SDO container"}
private

Definition at line 74 of file StripClusterTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
MuonSimData::word
int word() const
Definition: MuonSimData.h:89
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
NSWL1::StripClusterTool::m_sTgcSdoContainerKey
SG::ReadHandleKey< MuonSimDataCollection > m_sTgcSdoContainerKey
Definition: StripClusterTool.h:74
skel.it
it
Definition: skel.GENtoEVGEN.py:407
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
NSWL1::StripClusterTool::fill_strip_validation_id
StatusCode fill_strip_validation_id(const EventContext &ctx, std::vector< std::unique_ptr< StripClusterData >> &clusters, std::vector< std::shared_ptr< std::vector< std::unique_ptr< StripData > >> > &cluster_cache) const
Definition: StripClusterTool.cxx:28
MuonGM::MuonClusterReadoutElement::surface
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
Definition: MuonClusterReadoutElement.h:123
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
NSWL1::StripClusterTool::m_detManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detManagerKey
Definition: StripClusterTool.h:70
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonSimData::deposits
void deposits(std::vector< Deposit > &deposits) const
Definition: MuonSimData.h:99
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGM::sTgcReadoutElement
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:30
MuonSimDataCollection
Definition: MuonSimDataCollection.h:21
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
charge
double charge(const T &p)
Definition: AtlasPID.h:931
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MuonSimData
Definition: MuonSimData.h:62
item
Definition: ItemListSvc.h:43
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
a
TList * a
Definition: liststreamerinfos.cxx:10
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Trk::PlaneSurface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
Definition: PlaneSurface.cxx:204
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
NSWL1::StripClusterTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: StripClusterTool.h:71
NSWL1::StripClusterTool::m_isMC
Gaudi::Property< bool > m_isMC
Definition: StripClusterTool.h:73
Identifier
Definition: IdentifierFieldParser.cxx:14