65 StatusCode::enableFailure();
67 StatusCode::enableFailure();
74 std::unique_ptr< TFile >
ifile( TFile::Open(
fileName.data(),
"READ" ) );
88 Long64_t
entries =
event.getEntries();
90 const Long64_t
e = atoll(
argv[ 2 ] );
109 auto originTool = std::make_unique<InDet::InDetTrackTruthOriginTool> (
"InDetTrackTruthOriginTool" );
110 CHECK( originTool->initialize() );
111 ToolHandle< InDet::IInDetTrackTruthOriginTool > trackTruthOriginToolHandle( originTool.get() );
112 CHECK( filterTool.setProperty(
"trackOriginTool", trackTruthOriginToolHandle) );
115 CHECK( jetFilterTool.setProperty(
"trackOriginTool", trackTruthOriginToolHandle) );
143 std::vector< InDet::InDetTrackSystematicsTool* >
tools = {&smearingTool, &biasingTool, &filterTool, &jetFilterTool};
149 auto systCode =
tool->applySystematicVariation(systSet);
150 if (systCode != StatusCode::SUCCESS) {
151 Error(
APP_NAME,
"Failed to apply systematic variation on tool %s",
tool->name().data() );
157 std::string jetCollectionName =
"AntiKt4EMTopoJets";
160 auto outfile = std::make_unique<TFile>(
"InDetTrackSystsToolTester.out.root",
"RECREATE");
162 TH1* d0_before =
new TH1F(
"d0_before",
"original d_{0}",100,-5,5);
163 TH1* z0_before =
new TH1F(
"z0_before",
"original z_{0}",100,-200,200);
164 TH1* qOverP_before =
new TH1F(
"qOverP_before",
"original q/p", 200, -0.05, 0.05);
165 TH1* d0_after =
new TH1F(
"d0_after",
"d_{0} after",100,-5,5);
166 TH1* z0_after =
new TH1F(
"z0_after",
"z_{0} after",100,-200,200);
167 TH1* qOverP_after =
new TH1F(
"qOverP_after",
"q/p after", 200, -0.05, 0.05);
168 TH1* d0_diff =
new TH1F(
"d0_diff",
"#delta d_{0}",100,-1.0,1.0);
169 TH1* z0_diff =
new TH1F(
"z0_diff",
"#delta z_{0}",100,-10.0,10.0);
170 TH1* qOverP_diff =
new TH1F(
"qOverP_diff",
"#delta q/p", 200, -1.
e-5, 1.
e-5);
174 auto sc =
event.retrieve( ei,
"EventInfo" );
175 if ( !
sc.isSuccess() ) {
176 Error( __func__,
"Could not retreive event ahead of time to detect data/MC" );
187 event.getEntry(
entry );
198 std::pair< xAOD::TrackParticleContainer*, xAOD::ShallowAuxContainer* > ParticlesID_shallowCopy =
xAOD::shallowCopyContainer( *ParticlesID );
202 if ( !filterTool.accept(trkCpy) )
continue;
204 if ( doTIDE && !jetFilterTool.accept( trkCpy,
jets ) )
continue;
206 auto d0b = trkCpy->d0();
207 auto z0b = trkCpy->z0();
208 auto qOverPb = trkCpy->qOverP();
211 Error(__func__,
"Could not apply bias correction!" );
214 Error(__func__,
"Could not apply smearing correction!" );
217 auto d0a = trkCpy->d0();
218 auto z0a = trkCpy->z0();
219 auto qOverPa = trkCpy->qOverP();
220 auto d0d = d0a - d0b;
221 auto z0d = z0a - z0b;
222 auto qOverPd = qOverPa - qOverPb;
225 std::cout <<
"d0, before/after/diff:\t" << d0b
226 <<
"/" << d0a <<
"/" << d0d << std::endl;
227 std::cout <<
"z0, before/after/diff:\t" << z0b
228 <<
"/" << z0a <<
"/" << z0d << std::endl;
229 std::cout <<
"q/p, before/after/diff:\t" << qOverPb
230 <<
"/" << qOverPa <<
"/" << qOverPd << std::endl;
234 std::cout <<
"supressing debug output..." << std::endl;
238 d0_before->Fill( d0b );
239 z0_before->Fill( z0b );
240 qOverP_before->Fill( qOverPb );
241 d0_after->Fill( d0a );
242 z0_after->Fill( z0a );
243 qOverP_after->Fill( qOverPa );
244 d0_diff->Fill( d0d );
245 z0_diff->Fill( z0d );
246 qOverP_diff->Fill( qOverPd );
249 delete ParticlesID_shallowCopy.first;
250 delete ParticlesID_shallowCopy.second;