![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
27 static const int value = 1;
33 for (
unsigned int i = 0;
i <
N ; ++
i)
34 for (
unsigned int j = 0; j <=
i; ++j)
39 for (
int i = 0;
i <
rows; ++
i) {
40 for (
int j = 0; j <=
i; ++j) {
86 template <
class VECTOR,
class COVARIANCE>
119 ATH_MSG_INFO(
"########## EFTrackingSmearingAlg Configurations are ########## ");
142 ATH_MSG_INFO(
"########## EFTrackingSmearingAlg Configurations: That's it. ########## ");
144 std::string smearerName;
183 CHECK(
book(
new TH1F(
"d0res_function_vs_eta",
"#eta of track (p_{T}=10GeV);#eta",100, 0.0,4.0)));
184 CHECK(
book(
new TH1F(
"z0res_function_vs_eta",
"#eta of track (p_{T}=10GeV);#eta",100, 0.0,4.0)));
185 CHECK(
book(
new TH1F(
"curvres_function_vs_eta",
"#eta of track (p_{T}=10GeV);#eta",100, 0.0,4.0)));
186 CHECK(
book(
new TH1F(
"d0res_function_vs_pt",
"p_{T} of track (#eta=1);p_{T} [GeV]",100, 1.0,200.0)));
187 CHECK(
book(
new TH1F(
"z0res_function_vs_pt",
"p_{T} of track (#eta=1);p_{T} [GeV]",100, 1.0,200.0)));
188 CHECK(
book(
new TH1F(
"curvres_function_vs_pt",
"p_{T} of track (#eta=1);p_{T} [GeV]",100, 1.0,200.0)));
189 CHECK(
book(
new TH1F(
"effLRT_function_vs_d0",
"d_{0} of track;d_{0} [mm]",100, 0.001,600.0)));
190 hist(
"d0res_function_vs_eta")->Add(d0res_eta);
191 hist(
"z0res_function_vs_eta")->Add(z0res_eta);
192 hist(
"curvres_function_vs_eta")->Add(curvres_eta);
193 hist(
"d0res_function_vs_pt")->Add(d0res_pt);
194 hist(
"z0res_function_vs_pt")->Add(z0res_pt);
195 hist(
"curvres_function_vs_pt")->Add(curvres_pt);
196 hist(
"effLRT_function_vs_d0")->Add(effLRT_d0);
200 return StatusCode::SUCCESS;
207 return StatusCode::SUCCESS;
215 if (not inputTruth) {
217 return StatusCode::FAILURE;
220 ATH_CHECK( outputTruth_handle.
record( std::make_unique<xAOD::TruthParticleContainer>(), std::make_unique<xAOD::TruthParticleAuxContainer>() ) );
221 auto outputTruth = outputTruth_handle.
ptr();
238 int n_input_tracks=0;
239 int n_output_tracks=0;
240 int n_output_broad_tracks=0;
241 int n_output_narrow_tracks=0;
242 ATH_MSG_DEBUG (
"Found "<<inputTruth->size()<<
" input truth particles");
243 for (
const auto*
part : *inputTruth )
251 if (
part->isNeutral())
continue;
252 if (
pt <=0.)
continue;
255 <<
" curv=" << 1./
part->pt()
256 <<
" phi=" <<
part->phi()
257 <<
" eta=" <<
part->eta()
258 <<
" d0=" << d0Acc(*
part)
259 <<
" z0=" << z0Acc(*
part)
260 <<
" pT=" <<
part->pt()
261 <<
" PDGID=" <<
part->pdgId()
262 <<
" status=" <<
part->status()
277 double qoverPt =
part->charge()*1000./
pt;
282 for (
const auto& otrack : mySmearer->
Tracks)
285 outputTruth->push_back(newtrk);
287 auto newpt =
part->pt();
290 d0Decorator(*newtrk) = otrack.d0();
291 z0Decorator(*newtrk) = otrack.z0();
292 ptDecorator(*newtrk) = otrack.pt()*1000.;
295 newpt = ptAcc(*newtrk);
297 if (newpt==0.)
continue;
299 <<
" curv=" << 1./newpt
300 <<
" phi=" << newtrk->
phi()
301 <<
" eta=" << newtrk->
eta()
302 <<
" d0=" << d0Acc(*newtrk)
303 <<
" z0=" << z0Acc(*newtrk)
305 <<
" PDGID=" << newtrk->
pdgId()
306 <<
" status=" << newtrk->
status()
311 hist(
"track_output_eta")->
Fill(otrack.eta());
312 hist(
"track_output_theta")->
Fill(otrack.theta());
313 hist(
"track_output_pt" )->
Fill(
part->charge()*otrack.pt() );
314 hist(
"track_output_phi")->
Fill(otrack.phi());
315 hist(
"track_output_z0" )->
Fill(otrack.z0() );
316 hist(
"track_output_d0" )->
Fill(otrack.d0() );
319 hist(
"track_outputcoll_theta")->
Fill(thetaAcc(*newtrk));
320 hist(
"track_outputcoll_pt" )->
Fill(
part->charge()* newpt/1000.);
322 hist(
"track_outputcoll_z0" )->
Fill(z0Acc(*newtrk));
323 hist(
"track_outputcoll_d0" )->
Fill(d0Acc(*newtrk));
326 hist(
"track_delta_pt") ->
Fill((newpt -
part->pt())/1000.);
329 hist(
"track_delta_z0" )->
Fill(z0Acc(*newtrk) - z0Acc(*
part));
330 hist(
"track_delta_d0" )->
Fill(d0Acc(*newtrk) - d0Acc(*
part));
337 ATH_MSG_DEBUG (
"End of loop track #"<<n_input_tracks<<
" ---> "<<
" "<< n_output_tracks
338 <<
" "<<n_output_narrow_tracks<<
" "<<n_output_broad_tracks);
340 hist(
"n_input_tracks")->
Fill(n_input_tracks);
341 hist(
"n_output_tracks")->
Fill(n_output_tracks);
342 hist(
"n_output_narrow_tracks")->
Fill(n_output_narrow_tracks);
343 hist(
"n_output_broad_tracks")->
Fill(n_output_broad_tracks);
345 return StatusCode::SUCCESS;
353 auto ctx = getContext() ;
361 return StatusCode::FAILURE;
365 ATH_CHECK( outputTracks_handle.
record( std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>() ) );
366 auto outputTracks = outputTracks_handle.
ptr();
373 int n_input_tracks=0;
374 int n_output_tracks=0;
375 int n_output_broad_tracks=0;
376 int n_output_narrow_tracks=0;
381 xAOD::ParametersCovMatrix_t trkcov = trk->definingParametersCovMatrix();
382 auto trkcovvec = trk->definingParametersCovMatrixVec();
383 double theta=trk->theta();
387 <<
" curv=" << 1./trk->pt()
388 <<
" phi=" << trk->phi0()
389 <<
" eta=" << trk->eta()
390 <<
" d0=" << trk->d0()
391 <<
" z0=" << trk->z0()
392 <<
" pT=" << trk->pt()
404 hist(
"track_input_eta")->
Fill(trk->eta());
405 hist(
"track_input_theta")->
Fill(trk->theta());
407 hist(
"track_input_phi")->
Fill(trk->phi0());
408 hist(
"track_input_z0" )->
Fill(trk->z0());
409 hist(
"track_input_d0" )->
Fill(trk->d0());
419 auto trkcovvec = trk->definingParametersCovMatrixVec();
420 double qoverPt = trk->charge()*1000./
pt;
421 mySmearer->
AddTrack(trk->d0(),trk->z0(),qoverPt,trk->eta(),trk->phi0());
425 for (
const auto& otrack : mySmearer->
Tracks)
428 outputTracks->push_back(newtrk);
431 double sintheta=
std::sin(otrack.theta());
432 trkcov = trk->definingParametersCovMatrix();
433 auto newtrkcov = trkcov;
437 for (
int ii=0;ii<5;ii++)
for (
int jj=0;jj<5;jj++) {
468 (otrack.curv()*sintheta/1000.)
475 <<
" curv=" << 1./newtrk->
pt()
476 <<
" phi=" << newtrk->
phi()
477 <<
" eta=" << newtrk->
eta()
478 <<
" d0=" << newtrk->
d0()
479 <<
" z0=" << newtrk->
z0()
480 <<
" pT=" << newtrk->
pt()
483 <<
" sigma_d0=" << std::sqrt(std::abs(trkcov_out(
Trk::d0,
Trk::d0)))
484 <<
" sigma_z0=" << std::sqrt(std::abs(trkcov_out(
Trk::z0,
Trk::z0))) );
488 hist(
"track_output_eta")->
Fill(otrack.eta());
489 hist(
"track_output_theta")->
Fill(otrack.theta());
490 hist(
"track_output_pt" )->
Fill(trk->charge()*otrack.pt() );
491 hist(
"track_output_phi")->
Fill(otrack.phi());
492 hist(
"track_output_z0" )->
Fill(otrack.z0() );
493 hist(
"track_output_d0" )->
Fill(otrack.d0() );
499 hist(
"track_outputcoll_z0" )->
Fill(newtrk->
z0());
500 hist(
"track_outputcoll_d0" )->
Fill(newtrk->
d0());
502 hist(
"track_delta_eta")->
Fill(newtrk->
eta() - trk->eta());
503 hist(
"track_delta_pt")->
Fill((newtrk->
pt() - trk->pt())/1000.);
505 hist(
"track_delta_phi")->
Fill(newtrk->
phi() - trk->phi0());
506 hist(
"track_delta_z0" )->
Fill(newtrk->
z0() - trk->z0());
507 hist(
"track_delta_d0" )->
Fill(newtrk->
d0() - trk->d0());
509 auto trkcov_original = trk->definingParametersCovMatrix();
540 ATH_MSG_DEBUG (
"End of loop track #"<<n_input_tracks<<
" ---> "<<
" "<< n_output_tracks
541 <<
" "<<n_output_narrow_tracks<<
" "<<n_output_broad_tracks);
543 hist(
"n_input_tracks")->
Fill(n_input_tracks);
544 hist(
"n_output_tracks")->
Fill(n_output_tracks);
545 hist(
"n_output_narrow_tracks")->
Fill(n_output_narrow_tracks);
546 hist(
"n_output_broad_tracks")->
Fill(n_output_broad_tracks);
548 return StatusCode::SUCCESS;
556 double b_eta[3]={50,-5,5};
557 CHECK(
book(
new TH1F(
"track_input_eta",
"#eta of input tracks",b_eta[0],b_eta[1],b_eta[2])));
558 CHECK(
book(
new TH1F(
"track_input_theta",
"#Theta of input tracks",50,0.0,4.0)));
559 CHECK(
book(
new TH1F(
"track_input_pt" ,
"p_T of input tracks",50.0,-10.0,10.0)));
560 CHECK(
book(
new TH1F(
"track_input_phi",
"#phi of input tracks",50,-6.28,6.28)));
561 CHECK(
book(
new TH1F(
"track_input_z0" ,
"z_0 of input tracks",100,-50,50)));
562 CHECK(
book(
new TH1F(
"track_input_d0" ,
"d_0 of input tracks",50,-5,5)));
564 CHECK(
book(
new TH1F(
"track_input_sigma_theta",
"#sigma_{#Theta} of input tracks" ,50,0.0,0.001)));
565 CHECK(
book(
new TH1F(
"track_input_sigma_qOverP" ,
"#sigma_{q/P} of input tracks" ,50.0,0.0,0.0001)));
566 CHECK(
book(
new TH1F(
"track_input_sigma_phi" ,
"#sigma_{#phi} of input tracks" ,50,0.0,0.002)));
567 CHECK(
book(
new TH1F(
"track_input_sigma_z0" ,
"#sigma_{z_0} of input tracks" ,100,0.0,5)));
568 CHECK(
book(
new TH1F(
"track_input_sigma_d0" ,
"#sigma_{d_0} of input tracks" ,50,0.0,5)));
571 CHECK(
book(
new TH1F(
"n_input_tracks" ,
"Number of input tracks" ,maxtracks,0,maxtracks)));
572 CHECK(
book(
new TH1F(
"n_output_tracks" ,
"Number of output tracks" ,maxtracks,0,maxtracks)));
573 CHECK(
book(
new TH1F(
"n_output_narrow_tracks",
"Number of output tracks (narrow)" ,maxtracks,0,maxtracks)));
574 CHECK(
book(
new TH1F(
"n_output_broad_tracks" ,
"Number of output tracks (broad)" ,maxtracks,0,maxtracks)));
576 CHECK(
book(
new TH1F(
"track_output_eta",
"#eta of output tracks",50,-5,5)));
577 CHECK(
book(
new TH1F(
"track_output_theta",
"#Theta of output tracks",50,0.0,4.0)));
578 CHECK(
book(
new TH1F(
"track_output_pt" ,
"p_T of output tracks [GeV]",50,-10,10)));
579 CHECK(
book(
new TH1F(
"track_output_phi",
"#phi of output tracks",50,-6.28,6.28)));
580 CHECK(
book(
new TH1F(
"track_output_z0" ,
"z_0 of output tracks",100,-50,50)));
581 CHECK(
book(
new TH1F(
"track_output_d0" ,
"d_0 of output tracks",50,-5,5)));
583 CHECK(
book(
new TH1F(
"track_outputcoll_eta",
"#eta of output tracks collection",50,-5,5)));
584 CHECK(
book(
new TH1F(
"track_outputcoll_theta",
"#Theta of output tracks collection",50,0.0,4.0)));
585 CHECK(
book(
new TH1F(
"track_outputcoll_pt" ,
"p_T of output tracks collection [GeV]",50,-10,10)));
586 CHECK(
book(
new TH1F(
"track_outputcoll_phi",
"#phi of output tracks collection",50,-6.28,6.28)));
587 CHECK(
book(
new TH1F(
"track_outputcoll_z0" ,
"z_0 of output tracks collection",100,-50,50)));
588 CHECK(
book(
new TH1F(
"track_outputcoll_d0" ,
"d_0 of output tracks collection",50,-5,5)));
590 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_theta",
"#sigma_{#Theta} of output tracks collection" ,50,0.0,0.001)));
591 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_qOverP" ,
"#sigma_{q/P} of output tracks collection",50.0,0.0,0.0001)));
592 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_phi" ,
"#sigma_{#phi} of output tracks collection" ,50,0.0,0.002)));
593 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_z0" ,
"#sigma_{z_0} of output tracks collection" ,100,0.0,5)));
594 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_d0" ,
"#sigma_{d_0} of output tracks collection" ,50,0.0,5)));
596 CHECK(
book(
new TH1F(
"track_delta_sigma_theta",
"#sigma_{#Theta} of output tracks collection",100,-0.001,0.001)));
597 CHECK(
book(
new TH1F(
"track_delta_sigma_qOverP",
"#sigma_{q/P} of output tracks collection",100,-0.0001,0.0001)));
598 CHECK(
book(
new TH1F(
"track_delta_sigma_phi",
"#sigma_{#phi} of output tracks collection" ,100,-0.002,0.002)));
599 CHECK(
book(
new TH1F(
"track_delta_sigma_z0",
"#sigma_{z_0} of output tracks collection" ,100,-1.,1.)));
600 CHECK(
book(
new TH1F(
"track_delta_sigma_d0",
"#sigma_{d_0} of output tracks collection" ,100,-0.5,0.5)));
602 CHECK(
book(
new TH1F(
"track_delta_eta",
"tracks #Delta #eta",50,-1,1)));
603 CHECK(
book(
new TH1F(
"track_delta_pt",
"tracks #Delta #pt [GeV]",50,-2.,2.)));
604 CHECK(
book(
new TH1F(
"track_delta_crv" ,
"tracks #Delta crv",50,-1,1)));
605 CHECK(
book(
new TH1F(
"track_delta_phi",
"tracks #Delta #phi",50,-0.5,0.5)));
606 CHECK(
book(
new TH1F(
"track_delta_z0" ,
"tracks #Delta z_0 ",100,-10,10)));
607 CHECK(
book(
new TH1F(
"track_delta_d0" ,
"tracks #Delta d_0 ",50,-2,2)));
608 return StatusCode::SUCCESS;
StatusCode smearTruthParticles(const EventContext &ctx)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
DoubleProperty m_smearedTrackEfficiency_d0low_LRT
DoubleProperty m_outputTracksPtCut
BooleanProperty m_EnableFakes
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_z0DecoratorKey
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
@ z
global position (cartesian)
Scalar phi() const
phi method
const_pointer_type cptr()
Dereference the pointer.
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
StatusCode book_histograms()
BooleanProperty m_IncludeFakesInResolutionCalculation
Scalar eta() const
pseudorapidity method
BooleanProperty m_smearTruthParticle
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_ptDecoratorKey
Scalar theta() const
theta method
constexpr int CalculateCompressedSize(int n)
float z0() const
Returns the parameter.
void setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP)
Set the defining parameters.
bool msgLvl(const MSG::Level lvl) const
@ loc2
generic first and second local coordinate
std::vector< size_t > vec
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputTruthParticleKey
const std::string & key() const
Return the StoreGate ID for the referenced object.
@ pz
global momentum (cartesian)
std::vector< EFTrackingSmearing::FTS_Track > Tracks
@ u
Enums for curvilinear frames.
#define AmgSymMatrix(dim)
float d0() const
Returns the parameter.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_d0DecoratorKey
TrackParticle_v1 TrackParticle
Reference the current persistent version:
@ iEta
(old readout) will be skipped
BooleanProperty m_UseResolutionPtCutOff
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_inputTrackParticleKey
@ distEta
readout for silicon
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_inputTruthParticleKey
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
TruthParticle_v1 TruthParticle
Typedef to implementation.
#define CHECK(...)
Evaluate an expression and check for errors.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_outputTrackParticleKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual StatusCode finalize() override
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to get raw data (vec<float>) from the covariance.
float phi0() const
Returns the parameter, which has range to .
Ensure that the ATLAS eigen extensions are properly loaded.
float qOverP() const
Returns the parameter.
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition of ATLAS Math & Geometry primitives (Amg)
BooleanProperty m_parameterizedTrackEfficiency
@ trkMass
Extended perigee: mass.
void SetInputTracksPtCut(double ptcut)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void setDefiningParametersCovMatrix(const ParametersCovMatrix_t &cov)
Set the defining parameters covariance matrix.
DoubleProperty m_inputTracksPtCut
virtual StatusCode initialize() override
DoubleProperty m_smearedTrackEfficiency
LongLongProperty m_RandomSeed
void setDefiningParametersCovMatrixVec(const std::vector< float > &cov)
BooleanProperty m_UseCoinToss
int status() const
Status code.
void AddTrack(double d0, double z0, double curv, double eta, double phi)
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
virtual ~EFTrackingSmearingAlg()
virtual StatusCode execute() override
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
DoubleProperty m_smearedTrackEfficiency_d0high_LRT
Class describing a TrackParticle.
Helper class to provide constant type-safe access to aux data.
BooleanProperty m_enableMonitoring
DoubleProperty m_SigmaScaleFactor
int pdgId() const
PDG ID code.
EFTrackingSmearingAlg(const std::string &name, ISvcLocator *pSvcLocator)
BooleanProperty m_parameterizedTrackEfficiency_LRT
float theta() const
Returns the parameter, which has range 0 to .
BooleanProperty m_FakeKillerEnable
DoubleProperty m_SetResolutionPtCutOff
double charge() const
Physical charge.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)