|
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...
|
|
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 559 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
564 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::convert() segment " << event_data.m_segments.size()
565 <<
", N hits = " <<
hits.size());
567 if (
hits.size()<5) {
msg(MSG::ERROR) <<
"convert(): empty list of hits! size: " <<
hits.size() <<
endmsg;
return; }
573 int countOppositeSide(0);
581 if (countOppositeSide>5) {
582 ATH_MSG_DEBUG(
"convert(): removed " << countOppositeSide <<
" hits from the other side, N remaining hits: " <<
hits.size() );
585 ATH_MSG_WARNING(
"convert(): not enough hits after opposite side removal: " <<
hits.size() <<
", removed: "
586 << countOppositeSide );
591 double mean[10];
for (
double &
i :
mean)
i = 0.;
592 for (
auto & hit :
hits) {
594 mean[0] += (hit->detectorElement())->surface(hit->identify()).center().x();
595 mean[1] += (hit->detectorElement())->surface(hit->identify()).center().y();
597 for (
int i=0;
i<2;
i++)
mean[
i] /= (
double)
hits.size();
598 int iPivot(-1);
double yPivot(10000000.);
599 for (
unsigned int i=0;
i<
hits.size();
i++) {
612 if (
x2+
y2<yPivot) { yPivot =
x2+
y2; iPivot =
i; }
616 msg(MSG::ERROR) <<
"SF pivot index not found!!! " << yPivot <<
" " << iPivot <<
endmsg;
620 double cotanPhi =
mean[2] /
mean[4];
623 ATH_MSG_DEBUG(
"compare parameters phi: " << trackpar[1] <<
" vs. " <<
phi );
645 double Xparabola =
a[0];
646 double cotanParabola =
a[1];
647 double inverseSin3phi = 1. +
a[1]*
a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi);
648 double inverseR = 2. *
a[2] / inverseSin3phi;
651 msg(
MSG::DEBUG) <<
"TRT_TrackSegmentsMaker_BarrelCosmics: parabola fit, X: " << Xparabola <<
endmsg;
652 msg(
MSG::DEBUG) <<
" parabola fit, cotan: " << cotanParabola <<
" compare to " << cotanPhi <<
endmsg;
656 qOverp = inverseR / 0.6;
666 double f33 = 4. / ( 3. * (1.+cotanPhi*cotanPhi) *
mean[4] );
669 0. ,45633., 0., 0., 0.,
670 0. , 0., f33, 0., 0.,
671 0. , 0., 0., 0.2, 0.,
675 (
hits[iPivot]->detectorElement())->surface(
hits[iPivot]->
identify()).center().
z() );
685 if (phi<-M_PI || phi>0.)
msg(MSG::ERROR) <<
"phi value problem: " <<
phi <<
endmsg;
697 for (
const auto *DC :
hits) {
734 Amg::Vector3D faketransl(firstcenter.x(),firstcenter.y()-5.,firstcenter.z());
739 std::move(pseudoPar),
740 std::move(pseudocov),
742 rio.push_back( pseudo );
743 delete pseudoSurface;
747 chi2 /= ( 1. + cotanPhi*cotanPhi );
756 ATH_MSG_DEBUG(
"Add " << event_data.m_segments.size() <<
"th segment to list" );
757 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 195 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
199 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::endEvent()" );
202 if ( event_data.m_segmentDriftCirclesCount < event_data.m_segments.size() ) {
203 msg(MSG::WARNING) <<
"endEvent() you called the function t create the segments but not retrived them later??" <<
endmsg;
204 msg(MSG::WARNING) <<
"endEvent() deleting remaining elements of m_segments" <<
endmsg;
205 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 214 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
222 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find()" );
227 if (!event_data.m_segmentDriftCircles.empty()) {
228 msg(MSG::WARNING) <<
"TRT_TrackSegmentsMaker_BarrelCosmics::find() probably called twice per event? or newEvent / newRegion have not been called. check your program" <<
endmsg;
229 event_data.clear();
return;
232 std::vector<double>
x0,
phi, pivotX, pivotY, Xparabola, cotanParabola, InverseR;
233 std::vector<int> nHitsPosY, nHitsNegY;
236 int nIterations(15), countCalls(0);
237 while (countCalls<150) {
239 double xRange(1000.),
phiRange(M_PI_4);
240 double par[] = {0., M_PI_2, 0., 0., 0., 0., 0., 0.};
243 for (
int i=0;
i<nIterations;
i++) {
247 if ( !foundSeed )
break;
251 if ( xRange < 0.01 ||
phiRange < 0.00001)
break;
253 if (!foundSeed)
break;
258 int countAssociatedHits[] = {0, 0};
260 double sinphi = std::sqrt( 1. - cosphi*cosphi );
264 double measx[200], measy[200];
269 double a = (
par[3]-
it->x())*sinphi+(
it->y()-
par[4])*cosphi;
273 if (
m_magneticField && countMeas<200) { measx[countMeas] =
it->x(); measy[countMeas] =
it->y(); countMeas++; }
275 countAssociatedHits[(
it->y()>0)?0:1]++;
276 it = event_data.m_listHitCenter.erase(
it );
279 if ( countAssociatedHits[0]+countAssociatedHits[1] <
m_minHitsAboveTOT )
continue;
283 ATH_MSG_DEBUG(
"countAssociatedHits " << countAssociatedHits[0] <<
" "
285 x0.push_back(
par[0] );
phi.push_back(
par[1] ); nHitsPosY.push_back( countAssociatedHits[0] ); nHitsNegY.push_back( countAssociatedHits[1] );
287 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] );
293 int nFoundSegments =
x0.size();
if (nFoundSegments>10) nFoundSegments = 10;
295 for (
int i=0;
i<nFoundSegments;
i++) {
296 event_data.m_segmentDriftCircles.emplace_back();
303 for (
unsigned int i=0;
i<event_data.m_listHits.size();
i++) {
305 const Amg::Vector3D ¢er = event_data.m_listHits[
i]->detectorElement()->surface(event_data.m_listHits[
i]->identify()).center();
306 for (
int j=0; j<nFoundSegments; j++) {
308 if (nHitsPosY[j]<5 && center.y()>0.)
continue;
309 if (nHitsNegY[j]<5 && center.y()<0.)
continue;
312 double sinphi = std::sqrt(1./(1+cotanParabola[j]*cotanParabola[j]));
313 double cosphi = std::sqrt(1.-sinphi*sinphi);
if (cotanParabola[j]<0.) cosphi *= -1.;
314 double a = (pivotX[j]+Xparabola[j]-center.x())*sinphi+(center.y()-pivotY[j])*cosphi;
320 double sinphi = std::sqrt(1.-cosphi*cosphi);
321 residual = (
x0[j]-center.x())*sinphi+center.y()*cosphi;
325 event_data.m_segmentDriftCircles[j].push_back(event_data.m_listHits[
i]);
342 double mergeX0(100.), mergePhi(0.1);
343 for (
int i=0;
i<nFoundSegments;
i++) {
344 for (
int j=
i+1; j<nFoundSegments; j++) {
345 if ( std::abs(x0[
i]-x0[j])<mergeX0 && std::abs(
phi[
i]-
phi[j])<mergePhi ) {
348 mergeX0 = std::abs(x0[
i]-x0[j]);
349 mergePhi = std::abs(
phi[
i]-
phi[j]);
353 if (mergeI != mergeJ) {
354 ATH_MSG_DEBUG(
"Merge segments " << mergeI <<
" and " << mergeJ <<
" of size "
355 << event_data.m_segmentDriftCircles[mergeI].size() <<
", " << event_data.m_segmentDriftCircles[mergeJ].size()
356 <<
"; difference in the impact par x: " << mergeX0 <<
" phi: " << mergePhi );
357 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles[mergeJ].size();
i++) {
358 event_data.m_segmentDriftCircles[mergeI].push_back(event_data.m_segmentDriftCircles[mergeJ][
i]);
360 event_data.m_segmentDriftCircles[mergeJ].clear();
367 msg(
MSG::DEBUG) <<
"find() debug (" << nFoundSegments <<
")" ;
368 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
369 msg(
MSG::DEBUG) <<
" " <<
i <<
" " << event_data.m_segmentDriftCircles[
i].size();
374 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
376 double trackpar[] = {
x0[
i],
phi[
i]};
377 convert(event_data.m_segmentDriftCircles[
i], trackpar, event_data);
379 ATH_MSG_DEBUG(
"find(), number of converted segments: " << event_data.m_segments.size() );
◆ findOld()
Definition at line 841 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
843 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::find()");
847 if (!event_data.m_segmentDriftCircles.empty()) {
848 ATH_MSG_WARNING(
"find probably called twice per event? or newEvent / newRegion have not been called. check your program" );
849 event_data.clear();
return;
852 std::vector<double>
x0,
phi;
853 std::vector<int> nHitsPosY, nHitsNegY;
856 int nIterations(15), countCalls(0);
857 while (countCalls<150) {
859 double xRange(1000.),
phiRange(M_PI_4);
860 double par[] = {0., M_PI_2};
863 for (
int i=0;
i<nIterations;
i++) {
867 if ( !foundSeed )
break;
871 if ( xRange < 0.01 ||
phiRange < 0.00001)
break;
874 if (!foundSeed)
break;
877 int countAssociatedHits[] = {0, 0};
879 double sinphi = std::sqrt(1.-cosphi*cosphi);
883 if ( std::abs( (
par[0]-
it->x())*sinphi +
it->y()*cosphi ) > 2. ) { ++
it;
continue; }
884 countAssociatedHits[(
it->y()>0)?0:1]++;
885 it = event_data.m_listHitCenter.erase(
it );
888 if ( countAssociatedHits[0]+countAssociatedHits[1] <
m_minHitsAboveTOT )
continue;
890 x0.push_back(
par[0] );
phi.push_back(
par[1] ); nHitsPosY.push_back( countAssociatedHits[0] ); nHitsNegY.push_back( countAssociatedHits[1] );
896 int nFoundSegments =
x0.size();
897 if (nFoundSegments>10) nFoundSegments = 10;
898 for (
int i=0;
i<nFoundSegments;
i++) {
899 event_data.m_segmentDriftCircles.emplace_back();
902 for (
unsigned int i=0;
i<event_data.m_listHits.size();
i++) {
904 center = event_data.m_listHits[
i]->detectorElement()->surface(event_data.m_listHits[
i]->identify()).center();
906 for (
int j=0; j<nFoundSegments; j++) {
907 if (nHitsPosY[j]<5 && center.y()>0.)
continue;
908 if (nHitsNegY[j]<5 && center.y()<0.)
continue;
910 double sinphi = std::sqrt(1.-cosphi*cosphi);
911 if ( std::abs((x0[j]-center.x())*sinphi+center.y()*cosphi) < 2.) {
912 event_data.m_segmentDriftCircles[j].push_back(event_data.m_listHits[
i]);
921 msg(
MSG::DEBUG) <<
"find() debug (" << nFoundSegments <<
")" ;
922 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
924 << event_data.m_segmentDriftCircles[
i].size() ;
929 for (
unsigned int i=0;
i<event_data.m_segmentDriftCircles.size();
i++) {
931 double trackpar[] = {
x0[
i],
phi[
i]};
932 convert(event_data.m_segmentDriftCircles[
i], trackpar, event_data);
934 ATH_MSG_DEBUG(
"find(), number of converted segments: " << event_data.m_segments.size() );
◆ findSeed()
Definition at line 408 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
418 double searchWindow = (xbin>2.) ? xbin : 2.;
422 int binInX[100];
for (
int &
i : binInX)
i = 0;
426 double phi = phimin+(0.5+j)*phibin;
431 for (
auto &
k : event_data.m_listHitCenter) {
432 double transformX =
k.x() * sinphi -
k.y() * cosphi;
433 indexmin = (
int) ((transformX-transformXMin-searchWindow)/xbin);
434 indexmax = (
int) ((transformX-transformXMin+searchWindow)/xbin);
443 bestParameters[0] = ( xbin *
index + transformXMin) / sinphi;
444 bestParameters[1] =
phi;
◆ findSeedInverseR()
Definition at line 451 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
455 double sinphi = std::sqrt( 1. - cosphi*cosphi );
457 double parTransformX =
par[0] * sinphi;
459 double meanTransformY(0.);
460 int countMeanTransformY(0);
461 for (
auto &
k : event_data.m_listHitCenter) {
463 double transformX =
k.x() * sinphi -
k.y() * cosphi;
464 if ( std::abs(transformX-parTransformX) > 2. )
continue;
465 meanTransformY +=
k.x() * cosphi +
k.y() * sinphi;
466 countMeanTransformY++;
468 if (!countMeanTransformY) {
469 ATH_MSG_WARNING(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::findSeedInverseR(), no hits in the seed region???" );
472 meanTransformY /= (
double) countMeanTransformY;
481 double mean[] = { meanTransformY * cosphi + parTransformX * sinphi, meanTransformY * sinphi - parTransformX * cosphi };
482 int scanInverseR[101];
for (
int &
i : scanInverseR)
i = 0;
486 for (
auto &
it : event_data.m_listHitCenter) {
488 double transformX =
it.x() * sinphi -
it.y() * cosphi;
489 if ( std::abs(transformX-parTransformX) > 200. )
continue;
498 if (std::abs(
b)>0.0000001) {
499 double i1_tmp = ( window -
a ) /
b + 0.5;
500 double i2_tmp = ( -window -
a ) /
b + 0.5;
501 if (std::abs(i1_tmp)<1000.) { i1 = (
int) (std::ceil( i1_tmp )); i1 += 50; }
502 if (std::abs(i2_tmp)<1000.) { i2 = (
int) (std::ceil( i2_tmp )); i2 += 50; }
504 if (i1>100) { i1 = 100; }
else {
if (i1<0) i1 = 0; }
505 if (i2>100) { i2 = 100; }
else {
if (i2<0) i2 = 0; }
506 if (i1+i2==0 || i1+i2==200)
continue;
507 if (i1<=i2) {
for (
int i=i1;
i<=i2;
i++) scanInverseR[
i]++; }
508 else {
for (
int i=i2;
i<=i1;
i++) scanInverseR[
i]++; }
511 int iMax(-1), hitsMax(0);
512 for (
int i=0;
i<101;
i++)
if (scanInverseR[
i]>hitsMax) { iMax =
i; hitsMax = scanInverseR[
i]; }
514 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 99 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
101 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newEvent()");
106 if (not trtcontainer.isValid()) {
107 msg(MSG::ERROR) <<
"Could not find TRT_DriftCircles collection!" <<
endmsg;
108 std::stringstream
msg;
110 throw std::runtime_error(
msg.str());
113 std::unique_ptr<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>
114 event_data = std::make_unique<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>(trtcontainer.cptr());
116 for(
const auto *
it : *trtcontainer) {
119 if (!colNext) {
msg(MSG::WARNING) <<
"newEvent(): !colNext " <<
endmsg;
continue; }
121 for (
const auto *circleit : *colNext){
125 event_data->m_listHits.push_back( circleit );
127 double onMyTime = circleit->timeOverThreshold();
128 if ( circleit->firstBinHigh() && (circleit->trailingEdge() != 24) && (circleit->trailingEdge() != 0) ) onMyTime = ( (
double) circleit->trailingEdge() + 1 ) * 3.125;
131 const Amg::Vector3D ¢er = circleit->detectorElement()->surface(circleit->identify()).center();
132 event_data->m_listHitCenter.push_back( center );
138 ATH_MSG_DEBUG(
"skipping high occupancy event of " << event_data->m_listHits.size() <<
" barrel hits, limit at "
143 ATH_MSG_DEBUG(
"newEvent(): Number of TRT barrel hits: " << event_data->m_listHits.size()
144 <<
" Number of hits with TOT > " <<
m_minSeedTOT <<
": " << event_data->m_listHitCenter.size() );
146 return std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData>(event_data.release());
◆ newRegion()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 150 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
152 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::newRegion()" );
155 if (not trtcontainer.isValid()) {
156 msg(MSG::ERROR) <<
"m_trtcontainer is empty!!!" <<
endmsg;
157 std::stringstream
msg;
159 throw std::runtime_error(
msg.str());
162 std::unique_ptr<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>
163 event_data = std::make_unique<TRT_TrackSegmentsMaker_BarrelCosmics::EventData>(trtcontainer.cptr());
167 for ( InDet::TRT_DriftCircleContainer::const_iterator
w = trtcontainer->indexFind(
d);
w!=trtcontainer->end(); ++
w ) {
168 for(
const auto *circleit : **
w) {
172 event_data->m_listHits.push_back(circleit);
174 double onMyTime = circleit->timeOverThreshold();
175 if ( circleit->firstBinHigh() && (circleit->trailingEdge() != 24) && (circleit->trailingEdge() != 0) ) onMyTime = ( (
double) circleit->trailingEdge() + 1 ) * 3.125;
177 const Amg::Vector3D ¢er = circleit->detectorElement()->surface(circleit->identify()).center();
178 event_data->m_listHitCenter.push_back( center );
184 ATH_MSG_DEBUG(
"skipping high occupancy event of " << event_data->m_listHits.size() <<
" barrel hits, limit at "
189 ATH_MSG_DEBUG(
"newRegion(): Number of TRT barrel hits: " << event_data->m_listHits.size()
190 <<
" Number of hits with TOT > " <<
m_minSeedTOT <<
": " << event_data->m_listHitCenter.size() );
192 return std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData>(event_data.release());
◆ next()
Implements InDet::ITRT_TrackSegmentsMaker.
Definition at line 388 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
394 ATH_MSG_DEBUG(
"InDet::TRT_TrackSegmentsMaker_BarrelCosmics::next(): return "
395 << event_data.m_segmentDriftCirclesCount <<
" out of " << event_data.m_segments.size() );
397 if (event_data.m_segmentDriftCirclesCount > event_data.m_segments.size())
398 msg(MSG::ERROR) <<
"m_segmentDriftCirclesCount = " << event_data.m_segmentDriftCirclesCount <<
", m_segments.size() = "
399 << event_data.m_segments.size() <<
endmsg;
401 return (event_data.m_segmentDriftCirclesCount<event_data.m_segments.size())
402 ?(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 766 of file TRT_TrackSegmentsMaker_BarrelCosmics.cxx.
768 if (nhits<10)
return;
770 double shift[] = {0., 0.};
771 for (
int i=0;
i<nhits;
i++) { shift[0] += measx[
i]; shift[1] += measy[
i]; }
772 for (
double &
i : shift)
i /= (
double) nhits;
773 for (
int i=0;
i<nhits;
i++) { measx[
i] -= shift[0]; measy[
i] -= shift[1]; }
775 double mean[10];
for (
double &
i :
mean)
i = 0.;
776 for (
int i=0;
i<nhits;
i++) {
777 double x2 = measx[
i]*measx[
i];
778 double y2 = measy[
i]*measy[
i];
781 mean[2] += measx[
i]*measy[
i];
807 double Xparabola =
a[0];
808 double cotanParabola =
a[1];
809 double inverseSin3phi = 1. +
a[1]*
a[1]; inverseSin3phi *= std::sqrt(inverseSin3phi);
810 double inverseR = 2. *
a[2] / inverseSin3phi;
811 double sinphi = std::sqrt(1./(1+
a[1]*
a[1]));
812 double cosphi = std::sqrt(1.-sinphi*sinphi);
if (cotanParabola<0.) cosphi *= -1.;
817 result[3] = cotanParabola;
822 for (
int i=0;
i<nhits;
i++) {
823 double tmp = (Xparabola-measx[
i])*sinphi+measy[
i]*cosphi;
829 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
bool InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_magneticField |
|
private |
◆ m_maxTotalHits
int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_maxTotalHits |
|
private |
◆ m_mergeSegments
bool InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_mergeSegments |
|
private |
◆ m_minHitsAboveTOT
int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsAboveTOT |
|
private |
◆ m_minHitsForSeed
int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSeed |
|
private |
◆ m_minHitsForSegment
int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minHitsForSegment |
|
private |
◆ m_minSeedTOT
double InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_minSeedTOT |
|
private |
◆ m_nBinsInPhi
int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInPhi |
|
private |
◆ m_nBinsInX
int InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_nBinsInX |
|
private |
◆ m_trtid
const TRT_ID* InDet::TRT_TrackSegmentsMaker_BarrelCosmics::m_trtid |
|
protected |
◆ m_TRTManagerName
std::string 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.
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
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
bool msgLvl(const MSG::Level lvl) const
const std::string & key() const
Return the StoreGate ID for the referenced object.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
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
std::pair< std::vector< unsigned int >, bool > res
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
std::string m_TRTManagerName
Name of TRT det.
Trk::PrepRawDataCollection< TRT_DriftCircle > TRT_DriftCircleCollection
void findOld(TRT_TrackSegmentsMaker_BarrelCosmics::EventData &event_data) const
Eigen::Matrix< double, 3, 1 > Vector3D
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
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...
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
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)