 |
ATLAS Offline Software
|
Go to the documentation of this file.
37 ATH_MSG_INFO(
"Intialize TauTrackRNNClassifier tool : " << classifier );
43 return StatusCode::SUCCESS;
50 if (!vertexInHandle.
isValid()) {
51 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << vertexInHandle.
key());
52 return StatusCode::FAILURE;
69 std::vector<xAOD::TauTrack*> vLRTs;
71 while(
it != vTracks.end()) {
74 it = vTracks.erase(
it);
83 ATH_CHECK(classifier->classifyTracks(vLRTs, xTau, vertexContainer, tauTrackCon,
true));
93 std::vector<xAOD::TauTrack*> excludedTracks;
95 while(
it != vTracks.end()) {
98 excludedTracks.push_back(*
it);
99 it = vTracks.erase(
it);
107 ATH_CHECK(classifier->classifyTracks(excludedTracks, xTau, vertexContainer, tauTrackCon,
true));
113 ATH_CHECK(classifier->classifyTracks(vTracks, xTau, vertexContainer, tauTrackCon));
117 std::sort(tauTrackLinks.begin(), tauTrackLinks.end(),
sortTracks);
120 charge += trk->track()->charge();
143 return StatusCode::SUCCESS;
151 TrackRNN::TrackRNN(
const std::string&
name)
157 TrackRNN::~TrackRNN()
165 ATH_MSG_INFO(
"Using calibration file: " << inputWeightsPath);
167 std::ifstream nn_config_istream(inputWeightsPath);
174 return StatusCode::FAILURE;
177 return StatusCode::SUCCESS;
185 bool skipTracks)
const
187 if(vTracks.empty()) {
188 return StatusCode::SUCCESS;
199 idScoreCharged(*
track) = 0.;
200 idScoreConv(*
track) = 0.;
201 idScoreIso(*
track) = 0.;
202 idScoreFake(*
track) = 0.;
204 return StatusCode::SUCCESS;
215 seqInput[
"input_1"] = valueMap;
219 std::vector<double> vClassProb(5);
221 for (
unsigned int i = 0;
i < vTracks.size(); ++
i){
230 vClassProb[0] = mValue[
"type_0"][
i];
231 vClassProb[1] = mValue[
"type_1"][
i];
232 vClassProb[2] = mValue[
"type_2"][
i];
233 vClassProb[3] = mValue[
"type_3"][
i];
237 idScoreCharged(*vTracks[
i]) = vClassProb[0];
238 idScoreConv(*vTracks[
i]) = vClassProb[1];
239 idScoreIso(*vTracks[
i]) = vClassProb[2];
240 idScoreFake(*vTracks[
i]) = vClassProb[3];
243 for (
unsigned int j = 1; j < vClassProb.size(); ++j){
244 if(vClassProb[j] > vClassProb[iMaxIndex]) iMaxIndex = j;
253 }
else if(iMaxIndex == 0){
255 }
else if(iMaxIndex == 1){
257 }
else if(iMaxIndex == 2){
263 bool alreadyUsed =
false;
264 for (
unsigned int i = 0;
i < vTracks.size(); ++
i){
269 if( vTracks[
i]->
track() == tau_trk->track()) alreadyUsed =
true;
273 ATH_MSG_INFO(
"Found Already Used charged track new, now putting it as unclassified" );
283 return StatusCode::SUCCESS;
295 unsigned int n_timeSteps = vTracks.size();
300 valueMap[
"log(trackPt)"] = std::vector<double>(n_timeSteps);
301 valueMap[
"log(jetSeedPt)"] = std::vector<double>(n_timeSteps);
302 valueMap[
"trackPt/tauPtIntermediateAxis"] = std::vector<double>(n_timeSteps);
303 valueMap[
"trackEta"] = std::vector<double>(n_timeSteps);
304 valueMap[
"z0sinthetaTJVA"] = std::vector<double>(n_timeSteps);
305 valueMap[
"z0sinthetaSigTJVA"] = std::vector<double>(n_timeSteps);
306 valueMap[
"log(rConv)"] = std::vector<double>(n_timeSteps);
307 valueMap[
"tanh(rConvII/500)"] = std::vector<double>(n_timeSteps);
308 valueMap[
"dRJetSeedAxis"] = std::vector<double>(n_timeSteps);
309 valueMap[
"dRIntermediateAxis"] = std::vector<double>(n_timeSteps);
310 valueMap[
"tanh(d0SigTJVA/10)"] = std::vector<double>(n_timeSteps);
311 valueMap[
"tanh(d0TJVA/10)"] = std::vector<double>(n_timeSteps);
312 valueMap[
"qOverP*1000"] = std::vector<double>(n_timeSteps);
313 valueMap[
"numberOfInnermostPixelLayerHits"] = std::vector<double>(n_timeSteps);
314 valueMap[
"numberOfPixelSharedHits"] = std::vector<double>(n_timeSteps);
315 valueMap[
"numberOfSCTSharedHits"] = std::vector<double>(n_timeSteps);
316 valueMap[
"numberOfTRTHits"] = std::vector<double>(n_timeSteps);
317 valueMap[
"eProbabilityHT"] = std::vector<double>(n_timeSteps);
318 valueMap[
"nPixHits"] = std::vector<double>(n_timeSteps);
319 valueMap[
"nSCTHits"] = std::vector<double>(n_timeSteps);
320 valueMap[
"dz0_TV_PV0"] = std::vector<double>(n_timeSteps);
321 valueMap[
"log_sumpt_TV"] = std::vector<double>(n_timeSteps);
322 valueMap[
"log_sumpt2_TV"] = std::vector<double>(n_timeSteps);
323 valueMap[
"log_sumpt_PV0"] = std::vector<double>(n_timeSteps);
324 valueMap[
"log_sumpt2_PV0"] = std::vector<double>(n_timeSteps);
325 valueMap[
"charge"] = std::vector<double>(n_timeSteps);
327 valueMap[
"(trackPt/jetSeedPt)"] = std::vector<double>(n_timeSteps);
328 valueMap[
"numberOfInnermostPixelLayerEndcapHits"] = std::vector<double>(n_timeSteps);
329 valueMap[
"nSiHits"] = std::vector<double>(n_timeSteps);
335 double dz0_TV_PV0 = 0., sumpt_TV = 0., sumpt2_TV = 0., sumpt_PV0 = 0., sumpt2_PV0 = 0.;
336 if(vertexContainer !=
nullptr && !vertexContainer->
empty() && xTau.
vertex()!=
nullptr) {
340 sumpt_PV0 += (*trk)->pt();
341 sumpt2_PV0 +=
pow((*trk)->pt(), 2.);
344 sumpt_TV += (*trk)->pt();
345 sumpt2_TV +=
pow((*trk)->pt(), 2.);
379 valueMap[
"log(trackPt)"][
i] =
std::log( xTrackParticle->
pt() );
380 valueMap[
"log(jetSeedPt)"][
i] = log_ptJetSeed;
382 valueMap[
"trackEta"][
i] = xTrackParticle->
eta();
383 valueMap[
"z0sinthetaTJVA"][
i] = xTrack->z0sinthetaTJVA();
384 valueMap[
"z0sinthetaSigTJVA"][
i] = xTrack->z0sinthetaSigTJVA();
385 valueMap[
"log(rConv)"][
i] =
std::log( xTrack->rConv() );
386 valueMap[
"tanh(rConvII/500)"][
i] = std::tanh( xTrack->rConvII()/500. );
390 valueMap[
"tanh(d0SigTJVA/10)"][
i] = std::tanh( xTrack->d0SigTJVA()/10. );
391 valueMap[
"tanh(d0TJVA/10)"][
i] = std::tanh( xTrack->d0TJVA()/10. );
392 valueMap[
"qOverP*1000"][
i] = xTrackParticle->
qOverP()*1000.;
396 valueMap[
"numberOfTRTHits"][
i] =
nTRTHits;
398 valueMap[
"nPixHits"][
i] =
nPixelHits + nPixelDeadSensors;
399 valueMap[
"nSCTHits"][
i] =
nSCTHits + nSCTDeadSensors;
405 valueMap[
"charge"][
i] = xTrackParticle->
charge();
407 valueMap[
"(trackPt/jetSeedPt)"][
i] = xTrackParticle->
pt()/xTau.
ptJetSeed();
417 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
const_pointer_type cptr()
Dereference the pointer.
float charge() const
Returns the charge.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
@ nModifiedIsolationTracks
bool log_sumpt2_PV0(const xAOD::TauJet &tau, const xAOD::TauTrack &, float &out)
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
bool log_sumpt2_TV(const xAOD::TauJet &tau, const xAOD::TauTrack &, float &out)
float nPixelHits(const U &p)
float nSCTSharedHits(const U &p)
std::vector< xAOD::TauTrack * > allTauTracksNonConst(const xAOD::TauJet *tau, xAOD::TauTrackContainer *trackCont)
@ numberOfInnermostPixelLayerEndcapHits
these are the hits in the 0th pixel layer endcap [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
float nSCTHits(const U &p)
float nTRTHits(const U &p)
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
bool dz0_TV_PV0(const xAOD::TauJet &tau, const xAOD::TauTrack &, float &out)
float z() const
Returns the z position.
TauTrackLinks_t & allTauTrackLinksNonConst()
In order to sort track links.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool log_sumpt_TV(const xAOD::TauJet &tau, const xAOD::TauTrack &, float &out)
float qOverP() const
Returns the parameter.
double charge(const T &p)
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
GraphConfig parse_json_graph(std::istream &json)
float nPixelSharedHits(const U &p)
const Vertex * vertex() const
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
virtual FourMom_t p4() const
The full 4-momentum of the particle.
bool log_sumpt_PV0(const xAOD::TauJet &tau, const xAOD::TauTrack &, float &out)
void setDetail(TauJetParameters::Detail detail, int value)
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
std::map< std::string, OutputNodeConfig > outputs
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
double ptIntermediateAxis() const
constexpr int pow(int base, int exp) noexcept
std::vector< const TauTrack * > tracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Get the v<const pointer> to a given tauTrack collection associated with this tau.
bool empty() const noexcept
Returns true if the collection is empty.
float nSiHits(const U &p)
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer