ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
InDet::TRT_TrackSegmentsMaker_BarrelCosmics Class Reference

#include <TRT_TrackSegmentsMaker_BarrelCosmics.h>

Inheritance diagram for InDet::TRT_TrackSegmentsMaker_BarrelCosmics:
Collaboration diagram for InDet::TRT_TrackSegmentsMaker_BarrelCosmics:

Classes

class  EventData
 

Public Member Functions

 TRT_TrackSegmentsMaker_BarrelCosmics (const std::string &, const std::string &, const IInterface *)
 
virtual ~TRT_TrackSegmentsMaker_BarrelCosmics ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventDatanewEvent (const EventContext &ctx) const override
 
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventDatanewRegion (const EventContext &ctx, const std::vector< IdentifierHash > &) const override
 
void endEvent (InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
 
virtual void find (const EventContext &ctx, InDet::ITRT_TrackSegmentsMaker::IEventData &event_data, InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap &used) const override
 
virtual Trk::TrackSegmentnext (InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
 
virtual MsgStream & dump (MsgStream &out) const override
 
virtual std::ostream & dump (std::ostream &out) const override
 
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...
 

Protected Attributes

SG::ReadHandleKey< InDet::TRT_DriftCircleContainerm_driftCirclesName {this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve Drift Circles"}
 Container with TRT clusters. More...
 
StringProperty m_TRTManagerName
 
const TRT_IDm_trtid {nullptr}
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

int findSeed (double xmin, double xmax, double phimin, double phimax, double *bestParameters, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
 
void findSeedInverseR (double *par, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
 
void convert (std::vector< const InDet::TRT_DriftCircle * > &hits, double *trackpar, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
 
void findOld (TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) 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...
 

Static Private Member Functions

static void linearRegressionParabolaFit (double *mean, double *a)
 
static bool sortHits (const InDet::TRT_DriftCircle *, const InDet::TRT_DriftCircle *)
 sort hits on segment such that they are ordered from larger y to smaller (from top down) More...
 
static void segFit (double *measx, double *measy, int nhits, double *residuals=0, double *result=0)
 

Private Attributes

IntegerProperty m_maxTotalHits {this, "MaxTotalNumberOfBarrelHits", 21000}
 
IntegerProperty m_minHitsForSeed {this, "MinNumberOfHitsForSeed", -1}
 
IntegerProperty m_minHitsForSegment {this, "MinimalNumberOfTRTHits", 20}
 
IntegerProperty m_minHitsAboveTOT {this, "MinNumberOfHitsAboveTOT", -1}
 
IntegerProperty m_nBinsInX {this, "NbinsInX", 100}
 
IntegerProperty m_nBinsInPhi {this, "NbinsInPhi", 10}
 
DoubleProperty m_minSeedTOT
 
BooleanProperty m_magneticField
 
BooleanProperty m_mergeSegments {this, "MergeSegments", false}
 
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

AlgTool that creates TrackSegments out of TRT Driftcircles for barrel TRT only, specializing for cosmic runs (to be used for LVL2 trigger)

Author
Sasa..nosp@m.Frat.nosp@m.ina@c.nosp@m.ern..nosp@m.ch

Definition at line 42 of file TRT_TrackSegmentsMaker_BarrelCosmics.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

◆ TRT_TrackSegmentsMaker_BarrelCosmics()

InDet::TRT_TrackSegmentsMaker_BarrelCosmics::TRT_TrackSegmentsMaker_BarrelCosmics ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 23 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

25  : AthAlgTool(t,n,p)
26 {
27  declareInterface<ITRT_TrackSegmentsMaker>(this);
28 }

◆ ~TRT_TrackSegmentsMaker_BarrelCosmics()

virtual InDet::TRT_TrackSegmentsMaker_BarrelCosmics::~TRT_TrackSegmentsMaker_BarrelCosmics ( )
inlinevirtual

Definition at line 47 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

47 {};

Member Function Documentation

◆ convert()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::convert ( std::vector< const InDet::TRT_DriftCircle * > &  hits,
double *  trackpar,
TRT_TrackSegmentsMaker_BarrelCosmics::EventData event_data 
) const
private

Definition at line 531 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

533  {
534 //Track Segment production - based on TRT_TrackSegmentsMaker_ECcosmics Tool
535 
536  ATH_MSG_DEBUG("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::convert() segment " << event_data.m_segments.size()
537  << ", N hits = " << hits.size());
538 
539  if (hits.size()<5) { msg(MSG::ERROR) << "convert(): empty list of hits! size: " << hits.size() << endmsg; return; }
540 
541  // sort the vector of hits
543 
544  // remove hits from the opposite side
545  int countOppositeSide(0);
547  int side = m_trtid->barrel_ec( (*it)->identify() );
548  int previous = ( it == hits.begin() ) ? m_trtid->barrel_ec( (*(it+2))->identify() ) : m_trtid->barrel_ec( (*(it-1))->identify() );
549  int next = ( it == hits.end()-1 ) ? m_trtid->barrel_ec( (*(it-2))->identify() ) : m_trtid->barrel_ec( (*(it+1))->identify() );
550  if ( previous==next && side*next==-1 ) { it = hits.erase( it ); countOppositeSide++; }
551  else { ++it; }
552  }
553  if (countOppositeSide>5) {
554  ATH_MSG_DEBUG( "convert(): removed " << countOppositeSide << " hits from the other side, N remaining hits: " << hits.size() );
555  }
556  if (hits.size()<5) {
557  ATH_MSG_WARNING( "convert(): not enough hits after opposite side removal: " << hits.size() << ", removed: "
558  << countOppositeSide );
559  return;
560  }
561 
562  // make the linear regression fit
563  double mean[10]; for (double & i : mean) i = 0.;
564  for (auto & hit : hits) {
565 
566  mean[0] += (hit->detectorElement())->surface(hit->identify()).center().x();
567  mean[1] += (hit->detectorElement())->surface(hit->identify()).center().y();
568  }
569  for (int i=0; i<2; i++) mean[i] /= (double) hits.size();
570  int iPivot(-1); double yPivot(10000000.); // choose pivot closest to the mean
571  for (unsigned int i=0; i<hits.size(); i++) {
572  double x = (hits[i]->detectorElement())->surface(hits[i]->identify()).center().x() - mean[0];
573  double y = (hits[i]->detectorElement())->surface(hits[i]->identify()).center().y() - mean[1];
574  double x2 = x * x;
575  double y2 = y * y;
576  mean[2] += x * y;
577  mean[3] += x2;
578  mean[4] += y2;
579  mean[5] += x2 * y;
580  mean[6] += y2 * x;
581  mean[7] += x2 * x;
582  mean[8] += y2 * y;
583  mean[9] += y2 * y2;
584  if (x2+y2<yPivot) { yPivot = x2+y2; iPivot = i; }
585  }
586 
587  if (iPivot==-1) {
588  msg(MSG::ERROR) << "SF pivot index not found!!! " << yPivot << " " << iPivot << endmsg;
589  iPivot = 0;
590  }
591 
592  double cotanPhi = mean[2] / mean[4];
593  double phi = std::atan(1./cotanPhi); if (phi<0.) phi += M_PI;
594  ATH_MSG_DEBUG("compare parameters X : " << trackpar[0] << " vs. " << mean[0]-mean[1]*cotanPhi );
595  ATH_MSG_DEBUG("compare parameters phi: " << trackpar[1] << " vs. " << phi );
596 
597  double qOverp = 0.; // units q / MeV, set only if there is magnetic field
598 
599  if (m_magneticField) { // fit parabola instead of line, add circle if neccessary
600 
601  double A[6], discriminant, a[3];
602 
603  A[0] = mean[8]*mean[8]-mean[4]*mean[9]; // parabola fit
604  A[1] = mean[1]*mean[9]-mean[4]*mean[8];
605  A[2] = mean[4]*mean[4]-mean[1]*mean[8];
606  A[3] = mean[4]*mean[4]-mean[9];
607  A[4] = mean[8]-mean[1]*mean[4];
608  A[5] = mean[1]*mean[1]-mean[4];
609  discriminant = std::abs( std::pow(mean[4], 3) + mean[8]*mean[8] + mean[1]*mean[1]*mean[9] - mean[4]*(2.*mean[1]*mean[8]+mean[9]) );
610 
611  a[0] = A[0] * mean[0] + A[1] * mean[2] + A[2] * mean[6];
612  a[1] = A[1] * mean[0] + A[3] * mean[2] + A[4] * mean[6];
613  a[2] = A[2] * mean[0] + A[4] * mean[2] + A[5] * mean[6];
614  discriminant *= -1.;
615  for (double & i : a) { i /= discriminant; }
616 
617  double Xparabola = a[0];
618  double cotanParabola = a[1];
619  double inverseSin3phi = 1. + a[1]*a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi); // 1/sin^3phi
620  double inverseR = 2. * a[2] / inverseSin3phi;
621 
622  if (msgLvl(MSG::DEBUG)) {
623  msg(MSG::DEBUG) << "TRT_TrackSegmentsMaker_BarrelCosmics: parabola fit, X: " << Xparabola << endmsg;
624  msg(MSG::DEBUG) << " parabola fit, cotan: " << cotanParabola << " compare to " << cotanPhi << endmsg;
625  msg(MSG::DEBUG) << " parabola fit, 1/R: " << inverseR << "/ mm " << endmsg;
626  }
627 
628  qOverp = inverseR / 0.6; // [1/MeV]; 1 / (eBRC) = 1 / (e 2T 3 100 M m/s mm) / R[mm] = (1/R[mm]) / 0.6
629  }
630 
631 // errors from the fit:
632 // - for d: sigma_r / sqrt(N hits) -> sigma_d^2 =
633 // - for cotanPhi: sigma_r / (sqrt(N hits * <y^2>) * sinPhi)
634 // - for phi: 1 / (1 + cotanPhi^2) * DcotanPhi // note that this mthod gives a biased estimate for phi!
635 
636  Amg::MatrixX cov(5,5);
637 
638  double f33 = 4. / ( 3. * (1.+cotanPhi*cotanPhi) * mean[4] ); // see above, mean[4] = N hits * <y^2>
639  cov<<
640  4. , 0., 0., 0., 0.,
641  0. ,45633., 0., 0., 0.,
642  0. , 0., f33, 0., 0.,
643  0. , 0., 0., 0.2, 0.,
644  0. , 0., 0., 0., 1.;
645 
646  Amg::Vector3D hepVec( mean[0], mean[1],
647  (hits[iPivot]->detectorElement())->surface(hits[iPivot]->identify()).center().z() );
648 
649 
650  Amg::Transform3D htrans = Amg::Transform3D(Amg::Translation3D(hepVec)*Amg::RotationMatrix3D::Identity());
651 
652 
653 
655 
656  if (phi>0.) phi -= M_PI;
657  if (phi<-M_PI || phi>0.) msg(MSG::ERROR) << "phi value problem: " << phi << endmsg;
658 
659  Trk::LocalParameters par(0., 0., phi, M_PI_2, qOverp);
660 
661  ATH_MSG_DEBUG("pivot: " << sur->center() << ", cross-check: " << mean[0] << " " << mean[1] );
662 
663  // calculate TrackParameters so that one can calculate input for TRT_DriftCircleOnTrack
664  // Global direction of the track parameters
666 
668 
669  for (const auto *DC : hits) { // rewrite: InDet::TRT_DriftCircle -> InDet::TRT_DriftCircleOnTrack
670  // based on http://atlas-sw.cern.ch/cgi-bin/viewcvs-atlas.cgi/offline/InnerDetector/InDetRecTools/TRT_DriftCircleOnTrackTool/src/TRT_DriftCircleOnTrackNoDriftTimeTool.cxx?revision=1.11&view=markup
671 
672  // Straw identification
673  const InDetDD::TRT_BaseElement* pE = DC->detectorElement();
674  if (!pE) {
675  ATH_MSG_ERROR("convert(): no detectorElement info!");
676  continue;
677  }
678  Identifier iD = DC->identify();
680 
681  // TRT_DriftCircleOnTrack production
684  Amg::MatrixX cov(1,1); cov<<1.33333;
685  const InDet::TRT_DriftCircleOnTrack *element = new InDet::TRT_DriftCircleOnTrack(DC, std::move(lp), std::move(cov),
686  iH, 1., dir, Trk::NODRIFTTIME);
687  rio.push_back( dynamic_cast<const Trk::MeasurementBase *>(element) );
688  } // end fill rio
689 
690  // add pseudo measurement - follow up https://savannah.cern.ch/bugs/?41079
691 if (1) { // limit the scope of all these variables
692 
693  Trk::DefinedParameter pseudoz( 0., Trk::locZ);
694  Trk::DefinedParameter pseudotheta( M_PI/2., Trk::theta);
695  Trk::LocalParameters pseudoPar( pseudoz, pseudotheta );
696 
697  Amg::MatrixX pseudocov(2,2);
698  pseudocov <<
699  1. , 0.,
700  0. , .001;
701 
702  const Trk::Surface &surf = (hits[hits.size()-1]->detectorElement())->surface(hits[hits.size()-1]->identify());
703 
704  Amg::RotationMatrix3D linerot=surf.transform().rotation();
705  Amg::Vector3D firstcenter=surf.center();
706  Amg::Vector3D faketransl(firstcenter.x(),firstcenter.y()-5.,firstcenter.z());
707  Amg::Transform3D faketransf = Amg::Transform3D(linerot* Amg::Translation3D(faketransl));
708  Trk::StraightLineSurface *pseudoSurface = new Trk::StraightLineSurface( faketransf, 99999., 99999. );
709 
711  std::move(pseudoPar),
712  std::move(pseudocov),
713  *pseudoSurface );
714  rio.push_back( pseudo );
715  delete pseudoSurface;
716 }
717 
718  double chi2 = mean[3] - 2.*cotanPhi*mean[2] + mean[4]*cotanPhi*cotanPhi;
719  chi2 /= ( 1. + cotanPhi*cotanPhi );
720  int ndf = (int) hits.size() - 2;
721  ATH_MSG_DEBUG( "Chi2 = " << chi2 << ", ndf = " << ndf << ", chi2/ndf = " << chi2/ndf );
722  Trk::FitQuality * fqu = new Trk::FitQuality(chi2, ndf);
723 
725  std::move(par), std::move(cov), sur, std::move(rio), fqu, Trk::Segment::TRT_SegmentMaker);
726 
727  //add segment to list of segments
728  ATH_MSG_DEBUG( "Add " << event_data.m_segments.size() << "th segment to list" );
729  event_data.m_segments.push_back(segment);
730 }

◆ 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; }

◆ dump() [1/2]

virtual MsgStream& InDet::TRT_TrackSegmentsMaker_BarrelCosmics::dump ( MsgStream &  out) const
inlineoverridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 70 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

71  { return out; };

◆ dump() [2/2]

virtual std::ostream& InDet::TRT_TrackSegmentsMaker_BarrelCosmics::dump ( std::ostream &  out) const
inlineoverridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 72 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

73  { return out; };

◆ endEvent()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::endEvent ( InDet::ITRT_TrackSegmentsMaker::IEventData event_data) const
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 167 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

167  {
170 
171  ATH_MSG_DEBUG("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::endEvent()" );
172 
173  // elements of m_segments created by new have not been passed on
174  if ( event_data.m_segmentDriftCirclesCount < event_data.m_segments.size() ) {
175  msg(MSG::WARNING) << "endEvent() you called the function t create the segments but not retrived them later??" << endmsg;
176  msg(MSG::WARNING) << "endEvent() deleting remaining elements of m_segments" << endmsg;
177  for (unsigned int i=event_data.m_segmentDriftCirclesCount; i<event_data.m_segments.size(); i++) delete event_data.m_segments[i];
178  }
179 
180  }

◆ 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

◆ finalize()

StatusCode InDet::TRT_TrackSegmentsMaker_BarrelCosmics::finalize ( )
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 63 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

63  {
64  return StatusCode::SUCCESS;
65 }

◆ find()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find ( const EventContext &  ctx,
InDet::ITRT_TrackSegmentsMaker::IEventData event_data,
InDet::TRT_DetElementLink_xk::TRT_DetElemUsedMap used 
) const
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 186 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

188  {
191 
192  if (!m_magneticField) { findOld(event_data); return; }
193 
194  ATH_MSG_DEBUG("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find()" );
195 
196 
197  if ((int)event_data.m_listHitCenter.size()<m_minHitsAboveTOT) return;
198 
199  if (!event_data.m_segmentDriftCircles.empty()) { // debug only
200  msg(MSG::WARNING) << "TRT_TrackSegmentsMaker_BarrelCosmics::find() probably called twice per event? or newEvent / newRegion have not been called. check your program" << endmsg;
201  event_data.clear(); return;
202  }
203 
204  std::vector<double> x0, phi, pivotX, pivotY, Xparabola, cotanParabola, InverseR;
205  std::vector<int> nHitsPosY, nHitsNegY;
206 
207  // first find seeds
208  int nIterations(15), countCalls(0);
209  while (countCalls<150) {
210 
211  double xRange(1000.), phiRange(M_PI_4);
212  double par[] = {0., M_PI_2, 0., 0., 0., 0., 0., 0.};
213  int foundSeed(0);
214 
215  for (int i=0; i<nIterations; i++) {
216 
217  countCalls++;
218  foundSeed = findSeed( par[0]-xRange, par[0]+xRange, par[1]-phiRange, par[1]+phiRange, par, event_data);
219  if ( !foundSeed ) break;
220 
221  xRange /= 3.;
222  phiRange /= 2.;
223  if ( xRange < 0.01 || phiRange < 0.00001) break;
224  }
225  if (!foundSeed) break;
226 
227  if (m_magneticField) findSeedInverseR(par, event_data);
228 
229 // remove the hits associated with this region, save this region, search again
230  int countAssociatedHits[] = {0, 0};
231  double cosphi = std::cos( par[1] );
232  double sinphi = std::sqrt( 1. - cosphi*cosphi );
233  double range = (m_magneticField) ? 10. : 2.; // BE CAREFULL ABOUT THIS RANGE, IT USED TO BE 2 BUT PERHAPS IT SHOULD BE INCREASED TO 10 in the case of magnetic field!
234 
235 
236  double measx[200], measy[200];
237  int countMeas(0);
238 
239  for (std::vector< Amg::Vector3D>::iterator it = event_data.m_listHitCenter.begin(); it!=event_data.m_listHitCenter.end(); ) {
240 
241  double a = (par[3]-it->x())*sinphi+(it->y()-par[4])*cosphi;
242  double b = (m_magneticField) ? 0.5 * (std::pow(it->x()-par[3], 2.) + std::pow(it->y()-par[4], 2.) - std::pow(a, 2)) : 0.;
243  if ( std::abs(a+par[2]*b) > range ) { ++it; continue; }
244 
245  if (m_magneticField && countMeas<200) { measx[countMeas] = it->x(); measy[countMeas] = it->y(); countMeas++; }
246 
247  countAssociatedHits[(it->y()>0)?0:1]++;
248  it = event_data.m_listHitCenter.erase( it );
249  }
250 
251  if ( countAssociatedHits[0]+countAssociatedHits[1] < m_minHitsAboveTOT ) continue;
252 
253  if (m_magneticField) segFit(measx, measy, countMeas, nullptr, par+3);
254 
255  ATH_MSG_DEBUG("countAssociatedHits " << countAssociatedHits[0] << " "
256  << countAssociatedHits[1] << " m_minHitsAboveTOT " << m_minHitsAboveTOT );
257  x0.push_back( par[0] ); phi.push_back( par[1] ); nHitsPosY.push_back( countAssociatedHits[0] ); nHitsNegY.push_back( countAssociatedHits[1] );
258 
259  pivotX.push_back( par[3] ); pivotY.push_back( par[4] ); Xparabola.push_back( par[5] ); cotanParabola.push_back( par[6] ); InverseR.push_back( par[7] );
260  } // end for (int i=0; i<nIterations; i++) loop
261 // end finding seeds
262 
263 // save all TRT hits for found segments
264 
265  int nFoundSegments = x0.size(); if (nFoundSegments>10) nFoundSegments = 10; // number of found segments
266  {
267  for (int i=0; i<nFoundSegments; i++) {
268  event_data.m_segmentDriftCircles.emplace_back();
269  }
270  }
271 
272  double window = (m_magneticField) ? 4. : 2.; // change for magnetic field
273  double residual;
274 
275  for (unsigned int i=0; i<event_data.m_listHits.size(); i++) {
276 
277  const Amg::Vector3D &center = event_data.m_listHits[i]->detectorElement()->surface(event_data.m_listHits[i]->identify()).center();
278  for (int j=0; j<nFoundSegments; j++) {
279 
280  if (nHitsPosY[j]<5 && center.y()>0.) continue;
281  if (nHitsNegY[j]<5 && center.y()<0.) continue;
282 
283  if (m_magneticField) {
284  double sinphi = std::sqrt(1./(1+cotanParabola[j]*cotanParabola[j]));
285  double cosphi = std::sqrt(1.-sinphi*sinphi); if (cotanParabola[j]<0.) cosphi *= -1.;
286  double a = (pivotX[j]+Xparabola[j]-center.x())*sinphi+(center.y()-pivotY[j])*cosphi;
287  double b = 0.5 * (std::pow(center.x()-pivotX[j], 2.) + std::pow(center.y()-pivotY[j], 2.) - std::pow(a, 2)) ;
288  residual = a + InverseR[j] * b;
289 
290  } else {
291  double cosphi = std::cos(phi[j]);
292  double sinphi = std::sqrt(1.-cosphi*cosphi);
293  residual = (x0[j]-center.x())*sinphi+center.y()*cosphi;
294  }
295 
296  if (std::abs(residual)<window) {
297  event_data.m_segmentDriftCircles[j].push_back(event_data.m_listHits[i]);
298  break;
299  }
300  }
301  }
302  // end saving TRT hits
303 
304 
305 
306  // merge segments: can be simple: if 2 of them similar values of impact par -> copy hits from the second vector into the first one and clear the second one
307  // XXXXXXXX to do: determine the optimal merging parameters
308 
309  if (m_mergeSegments) { // merge segments, not yet tested properly
310 
311  if (x0.size()>1) {
312  int mergeI = 0;
313  int mergeJ = 0;
314  double mergeX0(100.), mergePhi(0.1);
315  for (int i=0; i<nFoundSegments; i++) {
316  for (int j=i+1; j<nFoundSegments; j++) {
317  if ( std::abs(x0[i]-x0[j])<mergeX0 && std::abs(phi[i]-phi[j])<mergePhi ) {
318  mergeI = i;
319  mergeJ = j;
320  mergeX0 = std::abs(x0[i]-x0[j]);
321  mergePhi = std::abs(phi[i]-phi[j]);
322  }
323  }
324  }
325  if (mergeI != mergeJ) {
326  ATH_MSG_DEBUG("Merge segments " << mergeI << " and " << mergeJ << " of size "
327  << event_data.m_segmentDriftCircles[mergeI].size() << ", " << event_data.m_segmentDriftCircles[mergeJ].size()
328  << "; difference in the impact par x: " << mergeX0 << " phi: " << mergePhi );
329  for (unsigned int i=0; i<event_data.m_segmentDriftCircles[mergeJ].size(); i++) {
330  event_data.m_segmentDriftCircles[mergeI].push_back(event_data.m_segmentDriftCircles[mergeJ][i]);
331  }
332  event_data.m_segmentDriftCircles[mergeJ].clear();
333  }
334  }
335  } // end merge segments
336 
337 
338  if (msgLvl(MSG::DEBUG)) { // debug: check how many hits per found segments
339  msg(MSG::DEBUG) << "find() debug (" << nFoundSegments << ")" ;
340  for (unsigned int i=0; i<event_data.m_segmentDriftCircles.size(); i++) {
341  msg(MSG::DEBUG) << " " << i << " " << event_data.m_segmentDriftCircles[i].size();
342  }
343  msg(MSG::DEBUG) << endmsg;
344  }
345 
346  for (unsigned int i=0; i<event_data.m_segmentDriftCircles.size(); i++) { // convert to segments
347  if ((int)event_data.m_segmentDriftCircles[i].size()<m_minHitsForSegment) continue;
348  double trackpar[] = {x0[i], phi[i]};
349  convert(event_data.m_segmentDriftCircles[i], trackpar, event_data);
350  }
351  ATH_MSG_DEBUG( "find(), number of converted segments: " << event_data.m_segments.size() );
352 }

◆ findOld()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findOld ( TRT_TrackSegmentsMaker_BarrelCosmics::EventData event_data) const
private

Definition at line 813 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

813  {
814 
815  ATH_MSG_DEBUG( "InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find()");
816 
817  if ((int)event_data.m_listHitCenter.size()<m_minHitsAboveTOT) return;
818 
819  if (!event_data.m_segmentDriftCircles.empty()) { // debug only
820  ATH_MSG_WARNING("find probably called twice per event? or newEvent / newRegion have not been called. check your program" );
821  event_data.clear(); return;
822  }
823 
824  std::vector<double> x0, phi;
825  std::vector<int> nHitsPosY, nHitsNegY;
826 
827  // first find seeds
828  int nIterations(15), countCalls(0);
829  while (countCalls<150) {
830 
831  double xRange(1000.), phiRange(M_PI_4);
832  double par[] = {0., M_PI_2};
833  int foundSeed(0);
834 
835  for (int i=0; i<nIterations; i++) {
836 
837  countCalls++;
838  foundSeed = findSeed( par[0]-xRange, par[0]+xRange, par[1]-phiRange, par[1]+phiRange, par, event_data);
839  if ( !foundSeed ) break;
840 
841  xRange /= 3.;
842  phiRange /= 2.;
843  if ( xRange < 0.01 || phiRange < 0.00001) break;
844 
845  }
846  if (!foundSeed) break;
847 
848 // remove the hits associated with this region, save this region, search again
849  int countAssociatedHits[] = {0, 0};
850  double cosphi = std::cos(par[1]);
851  double sinphi = std::sqrt(1.-cosphi*cosphi);
852 
853  for (std::vector< Amg::Vector3D >::iterator it = event_data.m_listHitCenter.begin(); it!=event_data.m_listHitCenter.end(); ) {
854 
855  if ( std::abs( (par[0]-it->x())*sinphi + it->y()*cosphi ) > 2. ) { ++it; continue; }
856  countAssociatedHits[(it->y()>0)?0:1]++;
857  it = event_data.m_listHitCenter.erase( it );
858  }
859 
860  if ( countAssociatedHits[0]+countAssociatedHits[1] < m_minHitsAboveTOT ) continue;
861 
862  x0.push_back( par[0] ); phi.push_back( par[1] ); nHitsPosY.push_back( countAssociatedHits[0] ); nHitsNegY.push_back( countAssociatedHits[1] );
863 
864  } // end for (int i=0; i<nIterations; i++) loop
865 // end finding seeds
866 
867 // save all TRT hits for found segments
868  int nFoundSegments = x0.size();
869  if (nFoundSegments>10) nFoundSegments = 10; // number of found segments
870  for (int i=0; i<nFoundSegments; i++) {
871  event_data.m_segmentDriftCircles.emplace_back();
872  }
873 
874  for (unsigned int i=0; i<event_data.m_listHits.size(); i++) {
875  const Amg::Vector3D &
876  center = event_data.m_listHits[i]->detectorElement()->surface(event_data.m_listHits[i]->identify()).center();
877 
878  for (int j=0; j<nFoundSegments; j++) {
879  if (nHitsPosY[j]<5 && center.y()>0.) continue;
880  if (nHitsNegY[j]<5 && center.y()<0.) continue;
881  double cosphi = std::cos(phi[j]);
882  double sinphi = std::sqrt(1.-cosphi*cosphi);
883  if ( std::abs((x0[j]-center.x())*sinphi+center.y()*cosphi) < 2.) {
884  event_data.m_segmentDriftCircles[j].push_back(event_data.m_listHits[i]);
885  break;
886  }
887  }
888  }
889  // end saving TRT hits
890 
891  if (msgLvl(MSG::DEBUG)) {
892  // debug: check how many hits per found segments
893  msg(MSG::DEBUG) << "find() debug (" << nFoundSegments << ")" ;
894  for (unsigned int i=0; i<event_data.m_segmentDriftCircles.size(); i++) {
895  msg(MSG::DEBUG) << " " << i << " " \
896  << event_data.m_segmentDriftCircles[i].size() ;
897  }
898  msg(MSG::DEBUG) << endmsg;
899  }
900 
901  for (unsigned int i=0; i<event_data.m_segmentDriftCircles.size(); i++) { // convert to segments
902  if ((int)event_data.m_segmentDriftCircles[i].size()<m_minHitsForSegment) continue;
903  double trackpar[] = {x0[i], phi[i]};
904  convert(event_data.m_segmentDriftCircles[i], trackpar, event_data);
905  }
906  ATH_MSG_DEBUG( "find(), number of converted segments: " << event_data.m_segments.size() );
907 }

◆ findSeed()

int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeed ( double  xmin,
double  xmax,
double  phimin,
double  phimax,
double *  bestParameters,
TRT_TrackSegmentsMaker_BarrelCosmics::EventData event_data 
) const
private

Definition at line 380 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

386 {
387  if ((int)event_data.m_listHitCenter.size()<m_minHitsAboveTOT) return 0;
388 
389  double xbin = (xmax-xmin) / (1.*m_nBinsInX);
390  double searchWindow = (xbin>2.) ? xbin : 2.; //searchWindow *= searchWindow;
391  double phibin = (phimax-phimin) / (1.*m_nBinsInPhi);
392  int maxHits(0), index, indexmin, indexmax;
393 
394  int binInX[100]; for (int & i : binInX) i = 0;
395 
396  for (int j=0; j<m_nBinsInPhi; j++) {
397 
398  double phi = phimin+(0.5+j)*phibin;
399  double cosphi( std::cos(phi) ), sinphi( std::sin(phi) );
400  for (int i=0; i<m_nBinsInX; i++) binInX[i] = 0;
401  double transformXMin(xmin*sinphi); xbin = (xmax-xmin)*sinphi / (1.*m_nBinsInX);
402 
403  for (auto & k : event_data.m_listHitCenter) {
404  double transformX = k.x() * sinphi - k.y() * cosphi;
405  indexmin = (int) ((transformX-transformXMin-searchWindow)/xbin);
406  indexmax = (int) ((transformX-transformXMin+searchWindow)/xbin);
407 
408  if (indexmin<0) indexmin=0;
409  if (indexmax>99) indexmax=99;
410  for (index = indexmin; index<=indexmax; index++) binInX[index]++;
411  }
412  index = -1;
413  for (int i=0; i<m_nBinsInX; i++) if (binInX[i]>maxHits) { index = i; maxHits = binInX[i]; }
414  if (index>=0) {
415  bestParameters[0] = ( xbin * index + transformXMin) / sinphi;
416  bestParameters[1] = phi;
417  }
418  }
419 
420  return (maxHits>=m_minHitsForSeed) ? 1 : 0;
421 }

◆ findSeedInverseR()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeedInverseR ( double *  par,
TRT_TrackSegmentsMaker_BarrelCosmics::EventData event_data 
) const
private

Definition at line 423 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

424  {
425 
426  double cosphi = std::cos( par[1] );
427  double sinphi = std::sqrt( 1. - cosphi*cosphi );
428 
429  double parTransformX = par[0] * sinphi;
430 
431  double meanTransformY(0.);
432  int countMeanTransformY(0);
433  for (auto & k : event_data.m_listHitCenter) { // first determine the mean
434 
435  double transformX = k.x() * sinphi - k.y() * cosphi;
436  if ( std::abs(transformX-parTransformX) > 2. ) continue;
437  meanTransformY += k.x() * cosphi + k.y() * sinphi;
438  countMeanTransformY++;
439  }
440  if (!countMeanTransformY) {
441  ATH_MSG_WARNING("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeedInverseR(), no hits in the seed region???" );
442  return;
443  }
444  meanTransformY /= (double) countMeanTransformY;
445 
446 
447 // hard-coded parameters in the second part of this function:
448 // search range: [-0.00202, 0.00202] divided into 101 bins of width 0.00004 (such that range [-0.00002, 0.00002] is bin 50)
449 // 1/R = 0.002/mm corresponds to R = 0.5 m
450 // circle search window: 200 mm (for R=1m, circle-to-line distance 0.5 m away from a common point is 130mm)
451 
452 // -> pivot at: x_pivot = meanTransformY * cosphi + parTransformX * sinphi; y_pivot = meanTransformY * sinphi - parTransformX * cosphi;
453  double mean[] = { meanTransformY * cosphi + parTransformX * sinphi, meanTransformY * sinphi - parTransformX * cosphi };
454  int scanInverseR[101]; for (int & i : scanInverseR) i = 0;
455 
456  double window = 10.; // parabola search window BE CAREFULL OF THIS RANGE!
457 
458  for (auto & it : event_data.m_listHitCenter) {
459 
460  double transformX = it.x() * sinphi - it.y() * cosphi;
461  if ( std::abs(transformX-parTransformX) > 200. ) continue; // search circles in a broad band
462 
463  double a = (mean[0]-it.x())*sinphi+(it.y()-mean[1])*cosphi; // TEST THAT THIS CONDITION ( if ( fabs(a) > 200. ) continue; ) IS THE SAME AS ABOVE!
464  double b = 0.5 * (std::pow(it.x()-mean[0], 2.) + std::pow(it.y()-mean[1], 2.) - std::pow(a, 2));
465 
466  // estimated allowed range in radius: x_1,2 = ( +- window - a ) / b -> get integer as ((int) (ceil(x/bin-0.5))) + 50
467  b *= 0.00004; // multiply by the bin width
468 
469  int i1(0), i2(0);
470  if (std::abs(b)>0.0000001) {
471  double i1_tmp = ( window - a ) / b + 0.5;
472  double i2_tmp = ( -window - a ) / b + 0.5;
473  if (std::abs(i1_tmp)<1000.) { i1 = (int) (std::ceil( i1_tmp )); i1 += 50; }
474  if (std::abs(i2_tmp)<1000.) { i2 = (int) (std::ceil( i2_tmp )); i2 += 50; }
475  }
476  if (i1>100) { i1 = 100; } else { if (i1<0) i1 = 0; }
477  if (i2>100) { i2 = 100; } else { if (i2<0) i2 = 0; }
478  if (i1+i2==0 || i1+i2==200) continue; // out of search range
479  if (i1<=i2) { for (int i=i1; i<=i2; i++) scanInverseR[i]++; }
480  else { for (int i=i2; i<=i1; i++) scanInverseR[i]++; }
481  }
482 
483  int iMax(-1), hitsMax(0);
484  for (int i=0; i<101; i++) if (scanInverseR[i]>hitsMax) { iMax = i; hitsMax = scanInverseR[i]; } // find max bin
485 
486  par[2] = 0.00004 * (iMax-50); // save estimated inverse radius
487  for (int i=0; i<2; i++) par[3+i] = mean[i]; }

◆ initialize()

StatusCode InDet::TRT_TrackSegmentsMaker_BarrelCosmics::initialize ( )
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 30 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

30  {
31 
32  ATH_MSG_DEBUG("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::initialize(), March 2012"
33  << ", magnetic field: " << (m_magneticField?"ON":"OFF")
34  << " search bins: " << m_nBinsInX << ", " << m_nBinsInPhi);
35 
36  StatusCode sc = StatusCode::SUCCESS;
37 
38  // Initialize ReadHandle
40  // TRT
41  if (detStore()->retrieve(m_trtid, "TRT_ID").isFailure()) {
42  ATH_MSG_FATAL("Could not get TRT ID helper");
43  return StatusCode::FAILURE;
44  }
45 
48 
49  ATH_MSG_DEBUG("m_minHitsForSegment = " << m_minHitsForSegment);
50  ATH_MSG_DEBUG("m_minHitsForSeed = " << m_minHitsForSeed);
51  ATH_MSG_DEBUG("m_minHitsAboveTOT = " << m_minHitsAboveTOT);
52 
53  if (m_minSeedTOT<0. || m_minSeedTOT>20.)
54  ATH_MSG_WARNING("initialize(): are you sure about the MinimalTOTForSeedSearch setting? (set at " << m_minSeedTOT << ")");
55 
56  ATH_MSG_DEBUG("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::initialize(), jobProperties: "
57  << "MinimalNumberOfTRTHits " << m_minHitsForSegment << ", MinimalTOTForSeedSearch: " << m_minSeedTOT
58  << ", m_minHitsForSeed: " << m_minHitsForSeed << ", m_minHitsAboveTOT: " << m_minHitsAboveTOT );
59 
60  return sc;
61 }

◆ 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()

const InterfaceID & InDet::ITRT_TrackSegmentsMaker::interfaceID ( )
inlinestaticinherited

Definition at line 110 of file ITRT_TrackSegmentsMaker.h.

111  {
112  return IID_ITRT_TrackSegmentsMaker;
113  }

◆ linearRegressionParabolaFit()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::linearRegressionParabolaFit ( double *  mean,
double *  a 
)
staticprivate

Definition at line 503 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

503  { // input: elsewhere calculated mean, output: result a
504 
505  double A[6], discriminant;
506 
507  A[0] = mean[8]*mean[8]-mean[4]*mean[9]; // parabola fit
508  A[1] = mean[1]*mean[9]-mean[4]*mean[8];
509  A[2] = mean[4]*mean[4]-mean[1]*mean[8];
510  A[3] = mean[4]*mean[4]-mean[9];
511  A[4] = mean[8]-mean[1]*mean[4];
512  A[5] = mean[1]*mean[1]-mean[4];
513  discriminant = std::abs( std::pow(mean[4], 3) + mean[8]*mean[8] + mean[1]*mean[1]*mean[9] - mean[4]*(2.*mean[1]*mean[8]+mean[9]) );
514 
515  a[0] = A[0] * mean[0] + A[1] * mean[2] + A[2] * mean[6];
516  a[1] = A[1] * mean[0] + A[3] * mean[2] + A[4] * mean[6];
517  a[2] = A[2] * mean[0] + A[4] * mean[2] + A[5] * mean[6];
518  discriminant *= -1.;
519  for (int i=0; i<3; i++) { a[i] /= discriminant; }
520 
521  double inverseSin3phi = 1. + a[1]*a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi); // 1/sin^3phi
522  a[2] *= 2. / inverseSin3phi; }

◆ 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  }

◆ newEvent()

std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newEvent ( const EventContext &  ctx) const
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 71 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

71  {
72 
73  ATH_MSG_DEBUG( "InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newEvent()");
74 
75 
76  SG::ReadHandle<InDet::TRT_DriftCircleContainer> trtcontainer(m_driftCirclesName, ctx); // get TRT_DriftCircle list from StoreGate containers
77 
78  if (not trtcontainer.isValid()) {
79  msg(MSG::ERROR) << "Could not find TRT_DriftCircles collection!" << endmsg;
80  std::stringstream msg;
81  msg << name() <<" no TRT drift circles : " << m_driftCirclesName.key();
82  throw std::runtime_error(msg.str());
83  }
84 
85  std::unique_ptr<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>
86  event_data = std::make_unique<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>(trtcontainer.cptr());
87 
88  for(const auto *it : *trtcontainer) {
89 
90  const InDet::TRT_DriftCircleCollection *colNext=&(*it);
91  if (!colNext) { msg(MSG::WARNING) << "newEvent(): !colNext " << endmsg; continue; }
92 
93  for (const auto *circleit : *colNext){
94 
95  if ( m_trtid->is_barrel((*circleit).identify()) ) { // TRT barrel
96 
97  event_data->m_listHits.push_back( circleit );
98 
99  double onMyTime = circleit->timeOverThreshold();
100  if ( circleit->firstBinHigh() && (circleit->trailingEdge() != 24) && (circleit->trailingEdge() != 0) ) onMyTime = ( (double) circleit->trailingEdge() + 1 ) * 3.125;
101  if (onMyTime < m_minSeedTOT) continue;
102 
103  const Amg::Vector3D &center = circleit->detectorElement()->surface(circleit->identify()).center();
104  event_data->m_listHitCenter.push_back( center );
105  }
106  }
107  } // end trtcontainer loop
108 
109  if ( m_maxTotalHits && ((int)event_data->m_listHits.size()) > m_maxTotalHits ) {
110  ATH_MSG_DEBUG( "skipping high occupancy event of " << event_data->m_listHits.size() << " barrel hits, limit at "
111  << m_maxTotalHits );
112  event_data->clear();
113  }
114 
115  ATH_MSG_DEBUG( "newEvent(): Number of TRT barrel hits: " << event_data->m_listHits.size()
116  << " Number of hits with TOT > " << m_minSeedTOT << ": " << event_data->m_listHitCenter.size() );
117 
118  return std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData>(event_data.release());
119 }

◆ newRegion()

std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newRegion ( const EventContext &  ctx,
const std::vector< IdentifierHash > &  vTRT 
) const
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 122 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

122  {
123 
124  ATH_MSG_DEBUG("InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newRegion()" );
125 
127  if (not trtcontainer.isValid()) {
128  msg(MSG::ERROR) << "m_trtcontainer is empty!!!" << endmsg;
129  std::stringstream msg;
130  msg << name() <<" no TRT drift circles : " << m_driftCirclesName.key();
131  throw std::runtime_error(msg.str());
132  }
133 
134  std::unique_ptr<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>
135  event_data = std::make_unique<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>(trtcontainer.cptr());
136 
137 
138  for(auto d : vTRT) {
139  for ( InDet::TRT_DriftCircleContainer::const_iterator w = trtcontainer->indexFind(d); w!=trtcontainer->end(); ++w ) {
140  for(const auto *circleit : **w) {
141 
142  if(std::abs(m_trtid->barrel_ec( circleit->identify() ))!=1) continue;
143 
144  event_data->m_listHits.push_back(circleit);
145 
146  double onMyTime = circleit->timeOverThreshold();
147  if ( circleit->firstBinHigh() && (circleit->trailingEdge() != 24) && (circleit->trailingEdge() != 0) ) onMyTime = ( (double) circleit->trailingEdge() + 1 ) * 3.125;
148  if (onMyTime < m_minSeedTOT) continue;
149  const Amg::Vector3D &center = circleit->detectorElement()->surface(circleit->identify()).center();
150  event_data->m_listHitCenter.push_back( center );
151  }
152  }
153  }
154 
155  if ( m_maxTotalHits && ((int)event_data->m_listHits.size()) > m_maxTotalHits ) {
156  ATH_MSG_DEBUG("skipping high occupancy event of " << event_data->m_listHits.size() << " barrel hits, limit at "
157  << m_maxTotalHits);
158  event_data->clear();
159  }
160 
161  ATH_MSG_DEBUG( "newRegion(): Number of TRT barrel hits: " << event_data->m_listHits.size()
162  << " Number of hits with TOT > " << m_minSeedTOT << ": " << event_data->m_listHitCenter.size() );
163 
164  return std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData>(event_data.release());
165 }

◆ next()

Trk::TrackSegment * InDet::TRT_TrackSegmentsMaker_BarrelCosmics::next ( InDet::ITRT_TrackSegmentsMaker::IEventData event_data) const
overridevirtual

Implements InDet::ITRT_TrackSegmentsMaker.

Definition at line 360 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

361 {
364 
365  // next 6 lines: for debugging purposes only
366  ATH_MSG_DEBUG( "InDet::TRT_TrackSegmentsMaker_BarrelCosmics::next(): return "
367  << event_data.m_segmentDriftCirclesCount << " out of " << event_data.m_segments.size() );
368 
369  if (event_data.m_segmentDriftCirclesCount > event_data.m_segments.size())
370  msg(MSG::ERROR) << "m_segmentDriftCirclesCount = " << event_data.m_segmentDriftCirclesCount << ", m_segments.size() = "
371  << event_data.m_segments.size() << endmsg;
372 
373  return (event_data.m_segmentDriftCirclesCount<event_data.m_segments.size())
374  ?(event_data.m_segments[event_data.m_segmentDriftCirclesCount++])
375  :nullptr;
376 }

◆ 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  }

◆ segFit()

void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::segFit ( double *  measx,
double *  measy,
int  nhits,
double *  residuals = 0,
double *  result = 0 
)
staticprivate

Definition at line 738 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

738  {
739 
740  if (nhits<10) return;
741 
742  double shift[] = {0., 0.}; // shift the points so that mean x = 0 and mean y = 0
743  for (int i=0; i<nhits; i++) { shift[0] += measx[i]; shift[1] += measy[i]; }
744  for (double & i : shift) i /= (double) nhits;
745  for (int i=0; i<nhits; i++) { measx[i] -= shift[0]; measy[i] -= shift[1]; }
746 
747  double mean[10]; for (double & i : mean) i = 0.; // calculate momenta needed for the line, circle and parabola fit
748  for (int i=0; i<nhits; i++) {
749  double x2 = measx[i]*measx[i];
750  double y2 = measy[i]*measy[i];
751  mean[0] += measx[i];
752  mean[1] += measy[i];
753  mean[2] += measx[i]*measy[i];
754  mean[3] += x2;
755  mean[4] += y2;
756  mean[5] += x2 * measy[i];
757  mean[6] += y2 * measx[i];
758  mean[7] += x2 * measx[i];
759  mean[8] += y2 * measy[i];
760  mean[9] += y2 * y2;
761  }
762  for (double & i : mean) i /= (double) nhits;
763 
764  double A[6], discriminant, a[3];
765 
766  A[0] = mean[8]*mean[8]-mean[4]*mean[9]; // parabola fit, no need for mean[3], [5], [7], se mi zdi
767  A[1] = mean[1]*mean[9]-mean[4]*mean[8];
768  A[2] = mean[4]*mean[4]-mean[1]*mean[8];
769  A[3] = mean[4]*mean[4]-mean[9];
770  A[4] = mean[8]-mean[1]*mean[4];
771  A[5] = mean[1]*mean[1]-mean[4];
772  discriminant = std::abs( std::pow(mean[4], 3) + mean[8]*mean[8] + mean[1]*mean[1]*mean[9] - mean[4]*(2.*mean[1]*mean[8]+mean[9]) );
773 
774  a[0] = A[0] * mean[0] + A[1] * mean[2] + A[2] * mean[6];
775  a[1] = A[1] * mean[0] + A[3] * mean[2] + A[4] * mean[6];
776  a[2] = A[2] * mean[0] + A[4] * mean[2] + A[5] * mean[6];
777  discriminant *= -1.;
778  for (double & i : a) i /= discriminant;
779  double Xparabola = a[0];
780  double cotanParabola = a[1];
781  double inverseSin3phi = 1. + a[1]*a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi); // 1/sin^3phi
782  double inverseR = 2. * a[2] / inverseSin3phi;
783  double sinphi = std::sqrt(1./(1+a[1]*a[1]));
784  double cosphi = std::sqrt(1.-sinphi*sinphi); if (cotanParabola<0.) cosphi *= -1.;
785 
786  if (result) {
787  for (int i=0; i<2; i++) result[i] = shift[i]; // pivot
788  result[2] = Xparabola;
789  result[3] = cotanParabola;
790  result[4] = inverseR;
791  }
792 
793  if (residuals) {
794  for (int i=0; i<nhits; i++) {
795  double tmp = (Xparabola-measx[i])*sinphi+measy[i]*cosphi;
796  double res = (tmp+0.5*inverseR*(std::pow(measx[i]-Xparabola, 2.) + std::pow(measy[i], 2.) - std::pow(tmp, 2)));
797  residuals[i] = res;
798  }
799  }
800 
801  for (int i=0; i<nhits; i++) { measx[i] += shift[0]; measy[i] += shift[1]; }
802 
803  }

◆ sortHits()

bool InDet::TRT_TrackSegmentsMaker_BarrelCosmics::sortHits ( const InDet::TRT_DriftCircle dc1,
const InDet::TRT_DriftCircle dc2 
)
staticprivate

sort hits on segment such that they are ordered from larger y to smaller (from top down)

Definition at line 524 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.

524  {
525 
526  double y1 = (dc1->detectorElement())->surface(dc1->identify()).center().y();
527  double y2 = (dc2->detectorElement())->surface(dc2->identify()).center().y();
528  return ( y1 > y2 );
529 }

◆ 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_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_driftCirclesName

SG::ReadHandleKey<InDet::TRT_DriftCircleContainer> InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_driftCirclesName {this,"TRT_ClustersContainer","TRT_DriftCircles","RHK to retrieve Drift Circles"}
protected

Container with TRT clusters.

Definition at line 109 of file TRT_TrackSegmentsMaker_BarrelCosmics.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_magneticField

BooleanProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_magneticField
private
Initial value:
{this, "IsMagneticFieldOn", true,
"search for lines (if False) or circles (if True)"}

Definition at line 157 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_maxTotalHits

IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_maxTotalHits {this, "MaxTotalNumberOfBarrelHits", 21000}
private

Definition at line 147 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_mergeSegments

BooleanProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_mergeSegments {this, "MergeSegments", false}
private

Definition at line 159 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_minHitsAboveTOT

IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsAboveTOT {this, "MinNumberOfHitsAboveTOT", -1}
private

Definition at line 151 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_minHitsForSeed

IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSeed {this, "MinNumberOfHitsForSeed", -1}
private

Definition at line 149 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_minHitsForSegment

IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSegment {this, "MinimalNumberOfTRTHits", 20}
private

Definition at line 150 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_minSeedTOT

DoubleProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minSeedTOT
private
Initial value:
{this, "MinimalTOTForSeedSearch", 10.,
"minimal time over threshold for seed search - default ~ 10 ns"}

Definition at line 155 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_nBinsInPhi

IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInPhi {this, "NbinsInPhi", 10}
private

Definition at line 153 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_nBinsInX

IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInX {this, "NbinsInX", 100}
private

Definition at line 152 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_trtid

const TRT_ID* InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_trtid {nullptr}
protected

Definition at line 113 of file TRT_TrackSegmentsMaker_BarrelCosmics.h.

◆ m_TRTManagerName

StringProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_TRTManagerName
protected
Initial value:
{this, "TrtManagerLocation", "TRT",
"Name of TRT det. manager"}

Definition at line 110 of file TRT_TrackSegmentsMaker_BarrelCosmics.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
Trk::LocalParameters
Definition: LocalParameters.h:98
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:254
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
Trk::locX
@ locX
Definition: ParamDefs.h:37
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::convert
void convert(std::vector< const InDet::TRT_DriftCircle * > &hits, double *trackpar, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:531
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
InDet::TRT_DriftCircle::detectorElement
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
return the detector element corresponding to this PRD
skel.it
it
Definition: skel.GENtoEVGEN.py:396
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::sortHits
static bool sortHits(const InDet::TRT_DriftCircle *, const InDet::TRT_DriftCircle *)
sort hits on segment such that they are ordered from larger y to smaller (from top down)
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:524
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_driftCirclesName
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_driftCirclesName
Container with TRT clusters.
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:109
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::TrackSegment
Definition: TrackSegment.h:56
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInX
IntegerProperty m_nBinsInX
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:152
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsAboveTOT
IntegerProperty m_minHitsAboveTOT
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:151
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_maxTotalHits
IntegerProperty m_maxTotalHits
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:147
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
x
#define x
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Trk::PseudoMeasurementOnTrack
Class to handle pseudo-measurements in fitters and on track objects.
Definition: PseudoMeasurementOnTrack.h:44
A
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:42
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::segFit
static void segFit(double *measx, double *measy, int nhits, double *residuals=0, double *result=0)
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:738
lumiFormat.i
int i
Definition: lumiFormat.py:85
xmin
double xmin
Definition: listroot.cxx:60
z
#define z
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeed
int findSeed(double xmin, double xmax, double phimin, double phimax, double *bestParameters, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:380
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_mergeSegments
BooleanProperty m_mergeSegments
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:159
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_magneticField
BooleanProperty m_magneticField
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:157
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_trtid
const TRT_ID * m_trtid
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:113
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ITk::EventData
InDet::SiSpacePointsSeedMakerEventData EventData
Definition: ITkSiSpacePointsSeedMaker.h:63
Trk::NODRIFTTIME
@ NODRIFTTIME
drift time was not used - drift radius is 0.
Definition: DriftCircleStatus.h:24
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
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
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
MuonR4::SegmentFit::ParamDefs::x0
@ x0
DataVector< const Trk::MeasurementBase >
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeedInverseR
void findSeedInverseR(double *par, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:423
beamspotman.dir
string dir
Definition: beamspotman.py:623
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
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
TauJetParameters::discriminant
@ discriminant
Definition: TauJetParameters.h:166
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDet::TRT_DriftCircleCollection
Trk::PrepRawDataCollection< TRT_DriftCircle > TRT_DriftCircleCollection
Definition: TRT_DriftCircleCollection.h:26
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findOld
void findOld(TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:813
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
ReadCellNoiseFromCool.indexmin
indexmin
Definition: ReadCellNoiseFromCool.py:226
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minSeedTOT
DoubleProperty m_minSeedTOT
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:155
DeMoScan.index
string index
Definition: DeMoScan.py:364
TRT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel.
Definition: TRT_ID.h:857
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
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
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInPhi
IntegerProperty m_nBinsInPhi
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:153
DEBUG
#define DEBUG
Definition: page_access.h:11
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
xmax
double xmax
Definition: listroot.cxx:61
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Trk::MeasurementBaseType::PseudoMeasurementOnTrack
@ PseudoMeasurementOnTrack
Definition: MeasurementBase.h:51
ReadCellNoiseFromCool.indexmax
indexmax
Definition: ReadCellNoiseFromCool.py:227
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::next
virtual Trk::TrackSegment * next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.cxx:360
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Trk::EventDataBase< EventData, InDet::ITRT_TrackSegmentsMaker::IEventData >::getPrivateEventData
static EventData & getPrivateEventData(InDet::ITRT_TrackSegmentsMaker::IEventData &virt_event_data)
Definition: EventDataBase.h:19
LArCellBinning.phiRange
phiRange
Filling Phi ranges.
Definition: LArCellBinning.py:107
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSegment
IntegerProperty m_minHitsForSegment
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:150
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSeed
IntegerProperty m_minHitsForSeed
Definition: TRT_TrackSegmentsMaker_BarrelCosmics.h:149
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::Segment::TRT_SegmentMaker
@ TRT_SegmentMaker
Definition: Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h:73
python.Dumpers.FitQuality
FitQuality
Definition: Dumpers.py:63
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
TRT_ID::straw_layer_hash
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
Definition: TRT_ID.h:750
fitman.k
k
Definition: fitman.py:528
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Trk::previous
@ previous
Definition: BinningData.h:32
Identifier
Definition: IdentifierFieldParser.cxx:14