|
ATLAS Offline Software
|
#include <TRT_TrackSegmentsMaker_BarrelCosmics.h>
|
| 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::IEventData > | newEvent (const EventContext &ctx) const override |
|
virtual std::unique_ptr< InDet::ITRT_TrackSegmentsMaker::IEventData > | newRegion (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::TrackSegment * | next (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 |
|
|
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...
|
|
|
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 |
|
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.
◆ StoreGateSvc_t
◆ TRT_TrackSegmentsMaker_BarrelCosmics()
InDet::TRT_TrackSegmentsMaker_BarrelCosmics::TRT_TrackSegmentsMaker_BarrelCosmics |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TRT_TrackSegmentsMaker_BarrelCosmics()
virtual InDet::TRT_TrackSegmentsMaker_BarrelCosmics::~TRT_TrackSegmentsMaker_BarrelCosmics |
( |
| ) |
|
|
inlinevirtual |
◆ convert()
Definition at line 531 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
536 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::convert() segment " << event_data.m_segments.size()
537 <<
", N hits = " <<
hits.size());
539 if (
hits.size()<5) {
msg(MSG::ERROR) <<
"convert(): empty list of hits! size: " <<
hits.size() <<
endmsg;
return; }
545 int countOppositeSide(0);
553 if (countOppositeSide>5) {
554 ATH_MSG_DEBUG(
"convert(): removed " << countOppositeSide <<
" hits from the other side, N remaining hits: " <<
hits.size() );
557 ATH_MSG_WARNING(
"convert(): not enough hits after opposite side removal: " <<
hits.size() <<
", removed: "
558 << countOppositeSide );
563 double mean[10];
for (
double &
i :
mean)
i = 0.;
564 for (
auto & hit :
hits) {
566 mean[0] += (hit->detectorElement())->surface(hit->identify()).center().x();
567 mean[1] += (hit->detectorElement())->surface(hit->identify()).center().y();
569 for (
int i=0;
i<2;
i++)
mean[
i] /= (
double)
hits.size();
570 int iPivot(-1);
double yPivot(10000000.);
571 for (
unsigned int i=0;
i<
hits.size();
i++) {
584 if (
x2+
y2<yPivot) { yPivot =
x2+
y2; iPivot =
i; }
588 msg(MSG::ERROR) <<
"SF pivot index not found!!! " << yPivot <<
" " << iPivot <<
endmsg;
592 double cotanPhi =
mean[2] /
mean[4];
595 ATH_MSG_DEBUG(
"compare parameters phi: " << trackpar[1] <<
" vs. " <<
phi );
617 double Xparabola =
a[0];
618 double cotanParabola =
a[1];
619 double inverseSin3phi = 1. +
a[1]*
a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi);
620 double inverseR = 2. *
a[2] / inverseSin3phi;
623 msg(
MSG::DEBUG) <<
"TRT_TrackSegmentsMaker_BarrelCosmics: parabola fit, X: " << Xparabola <<
endmsg;
624 msg(
MSG::DEBUG) <<
" parabola fit, cotan: " << cotanParabola <<
" compare to " << cotanPhi <<
endmsg;
628 qOverp = inverseR / 0.6;
638 double f33 = 4. / ( 3. * (1.+cotanPhi*cotanPhi) *
mean[4] );
641 0. ,45633., 0., 0., 0.,
642 0. , 0., f33, 0., 0.,
643 0. , 0., 0., 0.2, 0.,
647 (
hits[iPivot]->detectorElement())->surface(
hits[iPivot]->
identify()).center().
z() );
657 if (phi<-M_PI || phi>0.)
msg(MSG::ERROR) <<
"phi value problem: " <<
phi <<
endmsg;
669 for (
const auto *DC :
hits) {
706 Amg::Vector3D faketransl(firstcenter.x(),firstcenter.y()-5.,firstcenter.z());
711 std::move(pseudoPar),
712 std::move(pseudocov),
714 rio.push_back( pseudo );
715 delete pseudoSurface;
719 chi2 /= ( 1. + cotanPhi*cotanPhi );
728 ATH_MSG_DEBUG(
"Add " << event_data.m_segments.size() <<
"th segment to list" );
729 event_data.m_segments.push_back(
segment);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ dump() [1/2]
virtual MsgStream& InDet::TRT_TrackSegmentsMaker_BarrelCosmics::dump |
( |
MsgStream & |
out | ) |
const |
|
inlineoverridevirtual |
◆ dump() [2/2]
virtual std::ostream& InDet::TRT_TrackSegmentsMaker_BarrelCosmics::dump |
( |
std::ostream & |
out | ) |
const |
|
inlineoverridevirtual |
◆ endEvent()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 167 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
171 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::endEvent()" );
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];
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 |
◆ find()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 186 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
194 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find()" );
199 if (!event_data.m_segmentDriftCircles.empty()) {
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;
204 std::vector<double>
x0,
phi, pivotX, pivotY, Xparabola, cotanParabola, InverseR;
205 std::vector<int> nHitsPosY, nHitsNegY;
208 int nIterations(15), countCalls(0);
209 while (countCalls<150) {
211 double xRange(1000.),
phiRange(M_PI_4);
212 double par[] = {0., M_PI_2, 0., 0., 0., 0., 0., 0.};
215 for (
int i=0;
i<nIterations;
i++) {
219 if ( !foundSeed )
break;
223 if ( xRange < 0.01 ||
phiRange < 0.00001)
break;
225 if (!foundSeed)
break;
230 int countAssociatedHits[] = {0, 0};
232 double sinphi = std::sqrt( 1. - cosphi*cosphi );
236 double measx[200], measy[200];
241 double a = (
par[3]-
it->x())*sinphi+(
it->y()-
par[4])*cosphi;
245 if (
m_magneticField && countMeas<200) { measx[countMeas] =
it->x(); measy[countMeas] =
it->y(); countMeas++; }
247 countAssociatedHits[(
it->y()>0)?0:1]++;
248 it = event_data.m_listHitCenter.erase(
it );
251 if ( countAssociatedHits[0]+countAssociatedHits[1] <
m_minHitsAboveTOT )
continue;
255 ATH_MSG_DEBUG(
"countAssociatedHits " << countAssociatedHits[0] <<
" "
257 x0.push_back(
par[0] );
phi.push_back(
par[1] ); nHitsPosY.push_back( countAssociatedHits[0] ); nHitsNegY.push_back( countAssociatedHits[1] );
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] );
265 int nFoundSegments =
x0.size();
if (nFoundSegments>10) nFoundSegments = 10;
267 for (
int i=0;
i<nFoundSegments;
i++) {
268 event_data.m_segmentDriftCircles.emplace_back();
275 for (
unsigned int i=0;
i<event_data.m_listHits.size();
i++) {
277 const Amg::Vector3D ¢er = event_data.m_listHits[
i]->detectorElement()->surface(event_data.m_listHits[
i]->identify()).center();
278 for (
int j=0; j<nFoundSegments; j++) {
280 if (nHitsPosY[j]<5 && center.y()>0.)
continue;
281 if (nHitsNegY[j]<5 && center.y()<0.)
continue;
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;
292 double sinphi = std::sqrt(1.-cosphi*cosphi);
293 residual = (
x0[j]-center.x())*sinphi+center.y()*cosphi;
297 event_data.m_segmentDriftCircles[j].push_back(event_data.m_listHits[
i]);
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 ) {
320 mergeX0 = std::abs(x0[
i]-x0[j]);
321 mergePhi = std::abs(
phi[
i]-
phi[j]);
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]);
332 event_data.m_segmentDriftCircles[mergeJ].clear();
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();
346 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
348 double trackpar[] = {
x0[
i],
phi[
i]};
349 convert(event_data.m_segmentDriftCircles[
i], trackpar, event_data);
351 ATH_MSG_DEBUG(
"find(), number of converted segments: " << event_data.m_segments.size() );
◆ findOld()
Definition at line 813 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
815 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find()");
819 if (!event_data.m_segmentDriftCircles.empty()) {
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;
824 std::vector<double>
x0,
phi;
825 std::vector<int> nHitsPosY, nHitsNegY;
828 int nIterations(15), countCalls(0);
829 while (countCalls<150) {
831 double xRange(1000.),
phiRange(M_PI_4);
832 double par[] = {0., M_PI_2};
835 for (
int i=0;
i<nIterations;
i++) {
839 if ( !foundSeed )
break;
843 if ( xRange < 0.01 ||
phiRange < 0.00001)
break;
846 if (!foundSeed)
break;
849 int countAssociatedHits[] = {0, 0};
851 double sinphi = std::sqrt(1.-cosphi*cosphi);
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 );
860 if ( countAssociatedHits[0]+countAssociatedHits[1] <
m_minHitsAboveTOT )
continue;
862 x0.push_back(
par[0] );
phi.push_back(
par[1] ); nHitsPosY.push_back( countAssociatedHits[0] ); nHitsNegY.push_back( countAssociatedHits[1] );
868 int nFoundSegments =
x0.size();
869 if (nFoundSegments>10) nFoundSegments = 10;
870 for (
int i=0;
i<nFoundSegments;
i++) {
871 event_data.m_segmentDriftCircles.emplace_back();
874 for (
unsigned int i=0;
i<event_data.m_listHits.size();
i++) {
876 center = event_data.m_listHits[
i]->detectorElement()->surface(event_data.m_listHits[
i]->identify()).center();
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;
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]);
893 msg(
MSG::DEBUG) <<
"find() debug (" << nFoundSegments <<
")" ;
894 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
896 << event_data.m_segmentDriftCircles[
i].size() ;
901 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
903 double trackpar[] = {
x0[
i],
phi[
i]};
904 convert(event_data.m_segmentDriftCircles[
i], trackpar, event_data);
906 ATH_MSG_DEBUG(
"find(), number of converted segments: " << event_data.m_segments.size() );
◆ findSeed()
Definition at line 380 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
390 double searchWindow = (xbin>2.) ? xbin : 2.;
394 int binInX[100];
for (
int &
i : binInX)
i = 0;
398 double phi = phimin+(0.5+j)*phibin;
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);
415 bestParameters[0] = ( xbin *
index + transformXMin) / sinphi;
416 bestParameters[1] =
phi;
◆ findSeedInverseR()
Definition at line 423 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
427 double sinphi = std::sqrt( 1. - cosphi*cosphi );
429 double parTransformX =
par[0] * sinphi;
431 double meanTransformY(0.);
432 int countMeanTransformY(0);
433 for (
auto &
k : event_data.m_listHitCenter) {
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++;
440 if (!countMeanTransformY) {
441 ATH_MSG_WARNING(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeedInverseR(), no hits in the seed region???" );
444 meanTransformY /= (
double) countMeanTransformY;
453 double mean[] = { meanTransformY * cosphi + parTransformX * sinphi, meanTransformY * sinphi - parTransformX * cosphi };
454 int scanInverseR[101];
for (
int &
i : scanInverseR)
i = 0;
458 for (
auto &
it : event_data.m_listHitCenter) {
460 double transformX =
it.x() * sinphi -
it.y() * cosphi;
461 if ( std::abs(transformX-parTransformX) > 200. )
continue;
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; }
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;
479 if (i1<=i2) {
for (
int i=i1;
i<=i2;
i++) scanInverseR[
i]++; }
480 else {
for (
int i=i2;
i<=i1;
i++) scanInverseR[
i]++; }
483 int iMax(-1), hitsMax(0);
484 for (
int i=0;
i<101;
i++)
if (scanInverseR[
i]>hitsMax) { iMax =
i; hitsMax = scanInverseR[
i]; }
486 par[2] = 0.00004 * (iMax-50);
◆ initialize()
StatusCode InDet::TRT_TrackSegmentsMaker_BarrelCosmics::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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 |
◆ linearRegressionParabolaFit()
void InDet::TRT_TrackSegmentsMaker_BarrelCosmics::linearRegressionParabolaFit |
( |
double * |
mean, |
|
|
double * |
a |
|
) |
| |
|
staticprivate |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ newEvent()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 71 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
73 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newEvent()");
78 if (not trtcontainer.isValid()) {
79 msg(MSG::ERROR) <<
"Could not find TRT_DriftCircles collection!" <<
endmsg;
80 std::stringstream
msg;
82 throw std::runtime_error(
msg.str());
85 std::unique_ptr<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>
86 event_data = std::make_unique<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>(trtcontainer.cptr());
88 for(
const auto *
it : *trtcontainer) {
91 if (!colNext) {
msg(MSG::WARNING) <<
"newEvent(): !colNext " <<
endmsg;
continue; }
93 for (
const auto *circleit : *colNext){
97 event_data->m_listHits.push_back( circleit );
99 double onMyTime = circleit->timeOverThreshold();
100 if ( circleit->firstBinHigh() && (circleit->trailingEdge() != 24) && (circleit->trailingEdge() != 0) ) onMyTime = ( (
double) circleit->trailingEdge() + 1 ) * 3.125;
103 const Amg::Vector3D ¢er = circleit->detectorElement()->surface(circleit->identify()).center();
104 event_data->m_listHitCenter.push_back( center );
110 ATH_MSG_DEBUG(
"skipping high occupancy event of " << event_data->m_listHits.size() <<
" barrel hits, limit at "
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() );
118 return std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData>(event_data.release());
◆ newRegion()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 122 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
124 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newRegion()" );
127 if (not trtcontainer.isValid()) {
128 msg(MSG::ERROR) <<
"m_trtcontainer is empty!!!" <<
endmsg;
129 std::stringstream
msg;
131 throw std::runtime_error(
msg.str());
134 std::unique_ptr<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>
135 event_data = std::make_unique<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>(trtcontainer.cptr());
139 for ( InDet::TRT_DriftCircleContainer::const_iterator
w = trtcontainer->indexFind(
d);
w!=trtcontainer->end(); ++
w ) {
140 for(
const auto *circleit : **
w) {
144 event_data->m_listHits.push_back(circleit);
146 double onMyTime = circleit->timeOverThreshold();
147 if ( circleit->firstBinHigh() && (circleit->trailingEdge() != 24) && (circleit->trailingEdge() != 0) ) onMyTime = ( (
double) circleit->trailingEdge() + 1 ) * 3.125;
149 const Amg::Vector3D ¢er = circleit->detectorElement()->surface(circleit->identify()).center();
150 event_data->m_listHitCenter.push_back( center );
156 ATH_MSG_DEBUG(
"skipping high occupancy event of " << event_data->m_listHits.size() <<
" barrel hits, limit at "
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() );
164 return std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData>(event_data.release());
◆ next()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 360 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
366 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::next(): return "
367 << event_data.m_segmentDriftCirclesCount <<
" out of " << event_data.m_segments.size() );
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;
373 return (event_data.m_segmentDriftCirclesCount<event_data.m_segments.size())
374 ?(event_data.m_segments[event_data.m_segmentDriftCirclesCount++])
◆ outputHandles()
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()
◆ renounceArray()
◆ 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.
740 if (nhits<10)
return;
742 double shift[] = {0., 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]; }
747 double mean[10];
for (
double &
i :
mean)
i = 0.;
748 for (
int i=0;
i<nhits;
i++) {
749 double x2 = measx[
i]*measx[
i];
750 double y2 = measy[
i]*measy[
i];
753 mean[2] += measx[
i]*measy[
i];
779 double Xparabola =
a[0];
780 double cotanParabola =
a[1];
781 double inverseSin3phi = 1. +
a[1]*
a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi);
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.;
789 result[3] = cotanParabola;
794 for (
int i=0;
i<nhits;
i++) {
795 double tmp = (Xparabola-measx[
i])*sinphi+measy[
i]*cosphi;
801 for (
int i=0;
i<nhits;
i++) { measx[
i] += shift[0]; measy[
i] += shift[1]; }
◆ sortHits()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_driftCirclesName
◆ m_evtStore
◆ m_magneticField
BooleanProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_magneticField |
|
private |
◆ m_maxTotalHits
IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_maxTotalHits {this, "MaxTotalNumberOfBarrelHits", 21000} |
|
private |
◆ m_mergeSegments
BooleanProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_mergeSegments {this, "MergeSegments", false} |
|
private |
◆ m_minHitsAboveTOT
IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsAboveTOT {this, "MinNumberOfHitsAboveTOT", -1} |
|
private |
◆ m_minHitsForSeed
IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSeed {this, "MinNumberOfHitsForSeed", -1} |
|
private |
◆ m_minHitsForSegment
IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSegment {this, "MinimalNumberOfTRTHits", 20} |
|
private |
◆ m_minSeedTOT
DoubleProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minSeedTOT |
|
private |
◆ m_nBinsInPhi
IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInPhi {this, "NbinsInPhi", 10} |
|
private |
◆ m_nBinsInX
IntegerProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInX {this, "NbinsInX", 100} |
|
private |
◆ m_trtid
const TRT_ID* InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_trtid {nullptr} |
|
protected |
◆ m_TRTManagerName
StringProperty InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_TRTManagerName |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
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="")
Scalar phi() const
phi method
void convert(std::vector< const InDet::TRT_DriftCircle * > &hits, double *trackpar, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
return the detector element corresponding to this PRD
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)
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_driftCirclesName
Container with TRT clusters.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
const std::string & key() const
Return the StoreGate ID for the referenced object.
IntegerProperty m_nBinsInX
IntegerProperty m_minHitsAboveTOT
const Amg::Vector3D & center() const
Returns the center position of the Surface.
IntegerProperty m_maxTotalHits
std::pair< double, ParamDefs > DefinedParameter
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
Class to handle pseudo-measurements in fitters and on track objects.
static void segFit(double *measx, double *measy, int nhits, double *residuals=0, double *result=0)
int findSeed(double xmin, double xmax, double phimin, double phimax, double *bestParameters, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
BooleanProperty m_mergeSegments
std::pair< std::vector< unsigned int >, bool > res
BooleanProperty m_magneticField
double chi2(TH1 *h0, TH1 *h1)
InDet::SiSpacePointsSeedMakerEventData EventData
@ NODRIFTTIME
drift time was not used - drift radius is 0.
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
void findSeedInverseR(double *par, TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Identifier identify() const
return the identifier
Trk::PrepRawDataCollection< TRT_DriftCircle > TRT_DriftCircleCollection
void findOld(TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Eigen::Matrix< double, 3, 1 > Vector3D
DoubleProperty m_minSeedTOT
bool is_barrel(const Identifier &id) const
Test for barrel.
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.
#define ATH_MSG_WARNING(x)
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
IntegerProperty m_nBinsInPhi
Eigen::Translation< double, 3 > Translation3D
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
@ PseudoMeasurementOnTrack
virtual Trk::TrackSegment * next(InDet::ITRT_TrackSegmentsMaker::IEventData &event_data) const override
static EventData & getPrivateEventData(InDet::ITRT_TrackSegmentsMaker::IEventData &virt_event_data)
phiRange
Filling Phi ranges.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
IntegerProperty m_minHitsForSegment
constexpr int pow(int base, int exp) noexcept
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
IntegerProperty m_minHitsForSeed
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)