|
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;
208 if (not inputTruth) {
210 return StatusCode::FAILURE;
213 ATH_CHECK( outputTruth_handle.
record( std::make_unique<xAOD::TruthParticleContainer>(), std::make_unique<xAOD::TruthParticleAuxContainer>() ) );
214 auto outputTruth = outputTruth_handle.
ptr();
230 int n_input_tracks=0;
231 int n_output_tracks=0;
232 int n_output_broad_tracks=0;
233 int n_output_narrow_tracks=0;
234 ATH_MSG_DEBUG (
"Found "<<inputTruth->size()<<
" input truth particles");
235 for (
const auto*
part : *inputTruth )
243 if (
part->isNeutral())
continue;
244 if (
pt <=0.)
continue;
247 <<
" curv=" << 1./
part->pt()
248 <<
" phi=" <<
part->phi()
249 <<
" eta=" <<
part->eta()
250 <<
" d0=" << d0Acc(*
part)
251 <<
" z0=" << z0Acc(*
part)
252 <<
" pT=" <<
part->pt()
253 <<
" PDGID=" <<
part->pdgId()
254 <<
" status=" <<
part->status()
262 hist(
"track_input_eta")->Fill(
eta);
264 hist(
"track_input_pt" )->Fill(
pt/1000.);
265 hist(
"track_input_phi")->Fill(
phi);
266 hist(
"track_input_z0" )->Fill(
z0);
267 hist(
"track_input_d0" )->Fill(
d0);
269 double qoverPt =
part->charge()*1000./
pt;
277 outputTruth->push_back(newtrk);
279 auto newpt =
part->pt();
282 d0Decorator(*newtrk) = otrack.d0();
283 z0Decorator(*newtrk) = otrack.z0();
284 ptDecorator(*newtrk) = otrack.pt()*1000.;
287 newpt = ptAcc(*newtrk);
289 if (newpt==0.)
continue;
291 <<
" curv=" << 1./newpt
292 <<
" phi=" << newtrk->
phi()
293 <<
" eta=" << newtrk->
eta()
294 <<
" d0=" << d0Acc(*newtrk)
295 <<
" z0=" << z0Acc(*newtrk)
297 <<
" PDGID=" << newtrk->
pdgId()
298 <<
" status=" << newtrk->
status()
303 hist(
"track_output_eta")->Fill(otrack.eta());
304 hist(
"track_output_theta")->Fill(otrack.theta());
305 hist(
"track_output_pt" )->Fill(
part->charge()*otrack.pt() );
306 hist(
"track_output_phi")->Fill(otrack.phi());
307 hist(
"track_output_z0" )->Fill(otrack.z0() );
308 hist(
"track_output_d0" )->Fill(otrack.d0() );
310 hist(
"track_outputcoll_eta")->Fill(newtrk->
eta());
311 hist(
"track_outputcoll_theta")->Fill(thetaAcc(*newtrk));
312 hist(
"track_outputcoll_pt" )->Fill(
part->charge()* newpt/1000.);
313 hist(
"track_outputcoll_phi")->Fill(newtrk->
phi());
314 hist(
"track_outputcoll_z0" )->Fill(z0Acc(*newtrk));
315 hist(
"track_outputcoll_d0" )->Fill(d0Acc(*newtrk));
317 hist(
"track_delta_eta")->Fill(newtrk->
eta() -
part->eta());
318 hist(
"track_delta_pt") ->Fill((newpt -
part->pt())/1000.);
319 hist(
"track_delta_crv")->Fill(newtrk->
charge()*1000./newpt - ((
part->charge()*1000./
part->pt())));
320 hist(
"track_delta_phi")->Fill(newtrk->
phi() -
part->phi());
321 hist(
"track_delta_z0" )->Fill(z0Acc(*newtrk) - z0Acc(*
part));
322 hist(
"track_delta_d0" )->Fill(d0Acc(*newtrk) - d0Acc(*
part));
329 ATH_MSG_DEBUG (
"End of loop track #"<<n_input_tracks<<
" ---> "<<
" "<< n_output_tracks
330 <<
" "<<n_output_narrow_tracks<<
" "<<n_output_broad_tracks);
332 hist(
"n_input_tracks")->Fill(n_input_tracks);
333 hist(
"n_output_tracks")->Fill(n_output_tracks);
334 hist(
"n_output_narrow_tracks")->Fill(n_output_narrow_tracks);
335 hist(
"n_output_broad_tracks")->Fill(n_output_broad_tracks);
337 return StatusCode::SUCCESS;
345 auto ctx = getContext() ;
353 return StatusCode::FAILURE;
357 ATH_CHECK( outputTracks_handle.
record( std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>() ) );
358 auto outputTracks = outputTracks_handle.
ptr();
364 int n_input_tracks=0;
365 int n_output_tracks=0;
366 int n_output_broad_tracks=0;
367 int n_output_narrow_tracks=0;
372 xAOD::ParametersCovMatrix_t trkcov = trk->definingParametersCovMatrix();
373 auto trkcovvec = trk->definingParametersCovMatrixVec();
374 double theta=trk->theta();
378 <<
" curv=" << 1./trk->pt()
379 <<
" phi=" << trk->phi0()
380 <<
" eta=" << trk->eta()
381 <<
" d0=" << trk->d0()
382 <<
" z0=" << trk->z0()
383 <<
" pT=" << trk->pt()
395 hist(
"track_input_eta")->Fill(trk->eta());
396 hist(
"track_input_theta")->Fill(trk->theta());
397 hist(
"track_input_pt" )->Fill(
pt/1000.);
398 hist(
"track_input_phi")->Fill(trk->phi0());
399 hist(
"track_input_z0" )->Fill(trk->z0());
400 hist(
"track_input_d0" )->Fill(trk->d0());
410 auto trkcovvec = trk->definingParametersCovMatrixVec();
411 double qoverPt = trk->charge()*1000./
pt;
412 m_mySmearer->AddTrack(trk->d0(),trk->z0(),qoverPt,trk->eta(),trk->phi0());
419 outputTracks->push_back(newtrk);
422 double sintheta=
std::sin(otrack.theta());
423 trkcov = trk->definingParametersCovMatrix();
424 auto newtrkcov = trkcov;
428 for (
int ii=0;ii<5;ii++)
for (
int jj=0;jj<5;jj++) {
459 (otrack.curv()*sintheta/1000.)
466 <<
" curv=" << 1./newtrk->
pt()
467 <<
" phi=" << newtrk->
phi()
468 <<
" eta=" << newtrk->
eta()
469 <<
" d0=" << newtrk->
d0()
470 <<
" z0=" << newtrk->
z0()
471 <<
" pT=" << newtrk->
pt()
474 <<
" sigma_d0=" << std::sqrt(std::abs(trkcov_out(
Trk::d0,
Trk::d0)))
475 <<
" sigma_z0=" << std::sqrt(std::abs(trkcov_out(
Trk::z0,
Trk::z0))) );
479 hist(
"track_output_eta")->Fill(otrack.eta());
480 hist(
"track_output_theta")->Fill(otrack.theta());
481 hist(
"track_output_pt" )->Fill(trk->charge()*otrack.pt() );
482 hist(
"track_output_phi")->Fill(otrack.phi());
483 hist(
"track_output_z0" )->Fill(otrack.z0() );
484 hist(
"track_output_d0" )->Fill(otrack.d0() );
486 hist(
"track_outputcoll_eta")->Fill(newtrk->
eta());
487 hist(
"track_outputcoll_theta")->Fill(newtrk->
theta());
489 hist(
"track_outputcoll_phi")->Fill(newtrk->
phi0());
490 hist(
"track_outputcoll_z0" )->Fill(newtrk->
z0());
491 hist(
"track_outputcoll_d0" )->Fill(newtrk->
d0());
493 hist(
"track_delta_eta")->Fill(newtrk->
eta() - trk->eta());
494 hist(
"track_delta_pt")->Fill((newtrk->
pt() - trk->pt())/1000.);
496 hist(
"track_delta_phi")->Fill(newtrk->
phi() - trk->phi0());
497 hist(
"track_delta_z0" )->Fill(newtrk->
z0() - trk->z0());
498 hist(
"track_delta_d0" )->Fill(newtrk->
d0() - trk->d0());
500 auto trkcov_original = trk->definingParametersCovMatrix();
531 ATH_MSG_DEBUG (
"End of loop track #"<<n_input_tracks<<
" ---> "<<
" "<< n_output_tracks
532 <<
" "<<n_output_narrow_tracks<<
" "<<n_output_broad_tracks);
534 hist(
"n_input_tracks")->Fill(n_input_tracks);
535 hist(
"n_output_tracks")->Fill(n_output_tracks);
536 hist(
"n_output_narrow_tracks")->Fill(n_output_narrow_tracks);
537 hist(
"n_output_broad_tracks")->Fill(n_output_broad_tracks);
539 return StatusCode::SUCCESS;
547 double b_eta[3]={50,-5,5};
548 CHECK(
book(
new TH1F(
"track_input_eta",
"#eta of input tracks",b_eta[0],b_eta[1],b_eta[2])));
549 CHECK(
book(
new TH1F(
"track_input_theta",
"#Theta of input tracks",50,0.0,4.0)));
550 CHECK(
book(
new TH1F(
"track_input_pt" ,
"p_T of input tracks",50.0,-10.0,10.0)));
551 CHECK(
book(
new TH1F(
"track_input_phi",
"#phi of input tracks",50,-6.28,6.28)));
552 CHECK(
book(
new TH1F(
"track_input_z0" ,
"z_0 of input tracks",100,-50,50)));
553 CHECK(
book(
new TH1F(
"track_input_d0" ,
"d_0 of input tracks",50,-5,5)));
555 CHECK(
book(
new TH1F(
"track_input_sigma_theta",
"#sigma_{#Theta} of input tracks" ,50,0.0,0.001)));
556 CHECK(
book(
new TH1F(
"track_input_sigma_qOverP" ,
"#sigma_{q/P} of input tracks" ,50.0,0.0,0.0001)));
557 CHECK(
book(
new TH1F(
"track_input_sigma_phi" ,
"#sigma_{#phi} of input tracks" ,50,0.0,0.002)));
558 CHECK(
book(
new TH1F(
"track_input_sigma_z0" ,
"#sigma_{z_0} of input tracks" ,100,0.0,5)));
559 CHECK(
book(
new TH1F(
"track_input_sigma_d0" ,
"#sigma_{d_0} of input tracks" ,50,0.0,5)));
562 CHECK(
book(
new TH1F(
"n_input_tracks" ,
"Number of input tracks" ,maxtracks,0,maxtracks)));
563 CHECK(
book(
new TH1F(
"n_output_tracks" ,
"Number of output tracks" ,maxtracks,0,maxtracks)));
564 CHECK(
book(
new TH1F(
"n_output_narrow_tracks",
"Number of output tracks (narrow)" ,maxtracks,0,maxtracks)));
565 CHECK(
book(
new TH1F(
"n_output_broad_tracks" ,
"Number of output tracks (broad)" ,maxtracks,0,maxtracks)));
567 CHECK(
book(
new TH1F(
"track_output_eta",
"#eta of output tracks",50,-5,5)));
568 CHECK(
book(
new TH1F(
"track_output_theta",
"#Theta of output tracks",50,0.0,4.0)));
569 CHECK(
book(
new TH1F(
"track_output_pt" ,
"p_T of output tracks [GeV]",50,-10,10)));
570 CHECK(
book(
new TH1F(
"track_output_phi",
"#phi of output tracks",50,-6.28,6.28)));
571 CHECK(
book(
new TH1F(
"track_output_z0" ,
"z_0 of output tracks",100,-50,50)));
572 CHECK(
book(
new TH1F(
"track_output_d0" ,
"d_0 of output tracks",50,-5,5)));
574 CHECK(
book(
new TH1F(
"track_outputcoll_eta",
"#eta of output tracks collection",50,-5,5)));
575 CHECK(
book(
new TH1F(
"track_outputcoll_theta",
"#Theta of output tracks collection",50,0.0,4.0)));
576 CHECK(
book(
new TH1F(
"track_outputcoll_pt" ,
"p_T of output tracks collection [GeV]",50,-10,10)));
577 CHECK(
book(
new TH1F(
"track_outputcoll_phi",
"#phi of output tracks collection",50,-6.28,6.28)));
578 CHECK(
book(
new TH1F(
"track_outputcoll_z0" ,
"z_0 of output tracks collection",100,-50,50)));
579 CHECK(
book(
new TH1F(
"track_outputcoll_d0" ,
"d_0 of output tracks collection",50,-5,5)));
581 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_theta",
"#sigma_{#Theta} of output tracks collection" ,50,0.0,0.001)));
582 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_qOverP" ,
"#sigma_{q/P} of output tracks collection",50.0,0.0,0.0001)));
583 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_phi" ,
"#sigma_{#phi} of output tracks collection" ,50,0.0,0.002)));
584 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_z0" ,
"#sigma_{z_0} of output tracks collection" ,100,0.0,5)));
585 CHECK(
book(
new TH1F(
"track_outputcoll_sigma_d0" ,
"#sigma_{d_0} of output tracks collection" ,50,0.0,5)));
587 CHECK(
book(
new TH1F(
"track_delta_sigma_theta",
"#sigma_{#Theta} of output tracks collection",100,-0.001,0.001)));
588 CHECK(
book(
new TH1F(
"track_delta_sigma_qOverP",
"#sigma_{q/P} of output tracks collection",100,-0.0001,0.0001)));
589 CHECK(
book(
new TH1F(
"track_delta_sigma_phi",
"#sigma_{#phi} of output tracks collection" ,100,-0.002,0.002)));
590 CHECK(
book(
new TH1F(
"track_delta_sigma_z0",
"#sigma_{z_0} of output tracks collection" ,100,-1.,1.)));
591 CHECK(
book(
new TH1F(
"track_delta_sigma_d0",
"#sigma_{d_0} of output tracks collection" ,100,-0.5,0.5)));
593 CHECK(
book(
new TH1F(
"track_delta_eta",
"tracks #Delta #eta",50,-1,1)));
594 CHECK(
book(
new TH1F(
"track_delta_pt",
"tracks #Delta #pt [GeV]",50,-2.,2.)));
595 CHECK(
book(
new TH1F(
"track_delta_crv" ,
"tracks #Delta crv",50,-1,1)));
596 CHECK(
book(
new TH1F(
"track_delta_phi",
"tracks #Delta #phi",50,-0.5,0.5)));
597 CHECK(
book(
new TH1F(
"track_delta_z0" ,
"tracks #Delta z_0 ",100,-10,10)));
598 CHECK(
book(
new TH1F(
"track_delta_d0" ,
"tracks #Delta d_0 ",50,-2,2)));
599 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
std::unique_ptr< FakeTrackSmearer > m_mySmearer
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputTruthParticleKey
const std::string & key() const
Return the StoreGate ID for the referenced object.
@ pz
global momentum (cartesian)
@ 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.
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.
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.
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
constexpr int pow(int base, int exp) noexcept
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 .)