ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
TagNProbe Class Reference

#include <TagNProbe.h>

Collaboration diagram for TagNProbe:

Public Member Functions

 TagNProbe (const std::string &refName, double massMin, double massMax, bool unique_flag=true)
 
 TagNProbe (const std::string &refName0, const std::string &refName1, double massMin, double massMax, bool unique_flag=true)
 
virtual ~TagNProbe ()
 
void construct ()
 
void tag (const std::string &chainName)
 getters and setters More...
 
void probe (const std::string &chainName)
 
const std::string & tag () const
 
const std::string & probe () const
 
const std::string & type0 () const
 
const std::string & type1 () const
 
double mass0 () const
 
double mass1 () const
 
template<typename T >
std::vector< TIDA::Roi * > GetRois (std::vector< TIDA::Chain > &chains, const TrackSelector *selector, TrackFilter *filter, T *hmass, T *hmass_obj, TrigObjectMatcher *tom=0) const
 
template<typename T >
std::vector< TIDA::Roi * > GetRois (std::vector< TIDA::Chain > &chains, const TrackSelector *selector_tag, TrackFilter *filter_tag, const TrackSelector *selector_probe, TrackFilter *filter_probe, T *hmass, T *hmass_obj, TrigObjectMatcher *tom_tag=0, TrigObjectMatcher *tom_probe=0) const
 

Protected Member Functions

double pt (const TIDA::Track *t) const
 
double pt (const TrackTrigObject *t) const
 
template<typename T1 , typename T2 >
double mass (const T1 *t1, const T2 *t2) const
 
template<typename T >
bool selection (const TIDA::Roi &troi, const TIDA::Roi &proi, const TrackSelector *selector, TrackFilter *filter, T *hmass, T *hmass_obj, TrigObjectMatcher *tom=0) const
 
template<typename T >
bool selection (const TIDA::Roi &troi, const TIDA::Roi &proi, const TrackSelector *selector_tag, TrackFilter *filter_tag, const TrackSelector *selector_probe, TrackFilter *filter_probe, T *hmass, T *hmass_obj, TrigObjectMatcher *tom_tag=0, TrigObjectMatcher *tom_probe=0) const
 
double mass_obj (const TIDA::Track *t1, const TIDA::Track *t2, TrigObjectMatcher *tom=0) const
 
double mass_obj (const TIDA::Track *t1, const TIDA::Track *t2, TrigObjectMatcher *tom_tag, TrigObjectMatcher *tom_probe) const
 
TIDA::ChainfindChain (const std::string &chainname, std::vector< TIDA::Chain > &chains) const
 

Private Attributes

std::string m_particleType0
 
std::string m_particleType1
 
double m_mass0
 
double m_mass1
 
double m_massMin
 
double m_massMax
 
bool m_unique
 
std::string m_probeChainName
 
std::string m_tagChainName
 

Detailed Description

Definition at line 28 of file TagNProbe.h.

Constructor & Destructor Documentation

◆ TagNProbe() [1/2]

TagNProbe::TagNProbe ( const std::string &  refName,
double  massMin,
double  massMax,
bool  unique_flag = true 
)

Definition at line 28 of file TagNProbe.cxx.

29  :
30  m_particleType0(refName),
31  m_particleType1(refName),
32  m_mass0(0),
33  m_mass1(0),
34  m_massMin(massMin),
35  m_massMax(massMax),
36  m_unique(unique_flag)
37 {
38  construct();
39 }

◆ TagNProbe() [2/2]

TagNProbe::TagNProbe ( const std::string &  refName0,
const std::string &  refName1,
double  massMin,
double  massMax,
bool  unique_flag = true 
)

Definition at line 14 of file TagNProbe.cxx.

16  :
17  m_particleType0(refName0),
18  m_particleType1(refName1),
19  m_mass0(0),
20  m_mass1(0),
21  m_massMin(massMin),
22  m_massMax(massMax),
23  m_unique(unique_flag)
24 {
25  construct();
26 }

◆ ~TagNProbe()

virtual TagNProbe::~TagNProbe ( )
inlinevirtual

Definition at line 36 of file TagNProbe.h.

36 { }

Member Function Documentation

◆ construct()

void TagNProbe::construct ( )

Definition at line 42 of file TagNProbe.cxx.

42  {
43  const double muonMass = 0.10565; // GeV
44  const double electronMass = 0.000510; // GeV
45  const double tauMass = 1.77686; // GeV
46 
47  if ( m_particleType0.find("Muon")!=std::string::npos ) m_mass0 = muonMass;
48  else if ( m_particleType0.find("Electron")!=std::string::npos ) m_mass0 = electronMass;
49  else if ( m_particleType0.find("Tau")!=std::string::npos ) m_mass0 = tauMass;
50 
51  if ( m_particleType1.find("Muon")!=std::string::npos ) m_mass1 = muonMass;
52  else if ( m_particleType1.find("Electron")!=std::string::npos ) m_mass1 = electronMass;
53  else if ( m_particleType1.find("Tau")!=std::string::npos ) m_mass1 = tauMass;
54 }

◆ findChain()

TIDA::Chain * TagNProbe::findChain ( const std::string &  chainname,
std::vector< TIDA::Chain > &  chains 
) const
protected

Definition at line 92 of file TagNProbe.cxx.

92  {
93  for ( size_t i=chains.size() ; i-- ; ) {
94  if ( chains[i].name() == chainname ) return &chains[i];
95  }
96  return 0;
97 }

◆ GetRois() [1/2]

template<typename T >
std::vector<TIDA::Roi*> TagNProbe::GetRois ( std::vector< TIDA::Chain > &  chains,
const TrackSelector selector,
TrackFilter filter,
T *  hmass,
T *  hmass_obj,
TrigObjectMatcher tom = 0 
) const
inline

Definition at line 60 of file TagNProbe.h.

65  {
66  return GetRois( chains, selector, filter, selector, filter, hmass, hmass_obj, tom, tom );
67  }

◆ GetRois() [2/2]

template<typename T >
std::vector<TIDA::Roi*> TagNProbe::GetRois ( std::vector< TIDA::Chain > &  chains,
const TrackSelector selector_tag,
TrackFilter filter_tag,
const TrackSelector selector_probe,
TrackFilter filter_probe,
T *  hmass,
T *  hmass_obj,
TrigObjectMatcher tom_tag = 0,
TrigObjectMatcher tom_probe = 0 
) const
inline

tag and probe are the same: skip this tag

Definition at line 70 of file TagNProbe.h.

78  {
79 
80  std::vector<TIDA::Roi*> probes;
81 
82  TIDA::Chain* chain_tag = findChain( tag(), chains );
83  TIDA::Chain* chain_probe = findChain( probe(), chains );
84 
85  if ( chain_tag==0 || chain_probe==0 ) return probes;
86 
87  // loop for possible probes
88  for ( size_t ip=0 ; ip<chain_probe->size() ; ip++ ) {
89 
90  TIDA::Roi& proi = chain_probe->rois()[ip];
91 
92  TIDARoiDescriptor roi_probe( proi.roi() );
93 
94  bool found_tnp = false;
95 
96  // loop for possible tags
97  for ( size_t it=0 ; it<chain_tag->size() ; it++ ) {
98 
99  TIDA::Roi& troi = chain_tag->rois()[it];
100  TIDARoiDescriptor roi_tag( troi.roi() );
101 
103  if ( roi_probe == roi_tag ) continue;
104 
105  if ( selection( troi, proi, selector_tag, filter_tag, selector_probe, filter_probe,
106  hmass, hmass_obj, tom_tag, tom_probe ) ) {
107 
108  found_tnp = true;
109  if ( m_unique ) break;
110  }
111 
112  } // end loop on tags
113 
114  if ( found_tnp ) probes.push_back( &proi );
115 
116  } // end loop on probes
117 
118  return probes;
119 
120  }

◆ mass()

template<typename T1 , typename T2 >
double TagNProbe::mass ( const T1 *  t1,
const T2 *  t2 
) const
inlineprotected

Definition at line 128 of file TagNProbe.h.

128  {
129  TLorentzVector v1;
130  v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass0 );
131  TLorentzVector v2;
132  v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass1 );
133  return (v1+v2).M();
134  }

◆ mass0()

double TagNProbe::mass0 ( ) const
inline

Definition at line 54 of file TagNProbe.h.

54 { return m_mass0; };

◆ mass1()

double TagNProbe::mass1 ( ) const
inline

Definition at line 55 of file TagNProbe.h.

55 { return m_mass1; };

◆ mass_obj() [1/2]

double TagNProbe::mass_obj ( const TIDA::Track t1,
const TIDA::Track t2,
TrigObjectMatcher tom = 0 
) const
protected

Definition at line 58 of file TagNProbe.cxx.

58  {
59 
60  if ( tom!=0 && tom->status() ) {
61  return mass( tom->object(t1->id()), tom->object(t2->id()) );
62  }
63  else {
64  return mass( t1, t2 );
65  }
66 
67 }

◆ mass_obj() [2/2]

double TagNProbe::mass_obj ( const TIDA::Track t1,
const TIDA::Track t2,
TrigObjectMatcher tom_tag,
TrigObjectMatcher tom_probe 
) const
protected

different toms for each leg - eg if we wanted electron + tau

only tag tom ...

only probe tom ...

just tracks ...

Definition at line 70 of file TagNProbe.cxx.

70  {
71 
72  if ( tom_tag!=0 && tom_tag->status() && tom_probe!=0 && tom_probe->status() ) {
74  return mass( tom_tag->object(t1->id()), tom_probe->object(t2->id()) );
75  }
76  else if ( tom_tag!=0 && tom_tag->status() ) {
78  return mass( tom_tag->object(t1->id()), t2 );
79  }
80  else if ( tom_probe!=0 && tom_probe->status() ) {
82  return mass( t1, tom_probe->object(t2->id()) );
83  }
84  else {
86  return mass( t1, t2 );
87  }
88 
89 }

◆ probe() [1/2]

const std::string& TagNProbe::probe ( ) const
inline

Definition at line 49 of file TagNProbe.h.

49 { return m_probeChainName; }

◆ probe() [2/2]

void TagNProbe::probe ( const std::string &  chainName)
inline

Definition at line 46 of file TagNProbe.h.

◆ pt() [1/2]

double TagNProbe::pt ( const TIDA::Track t) const
inlineprotected

Definition at line 124 of file TagNProbe.h.

124 { return t->pT(); }

◆ pt() [2/2]

double TagNProbe::pt ( const TrackTrigObject t) const
inlineprotected

Definition at line 125 of file TagNProbe.h.

125 { return t->pt(); }

◆ selection() [1/2]

template<typename T >
bool TagNProbe::selection ( const TIDA::Roi troi,
const TIDA::Roi proi,
const TrackSelector selector,
TrackFilter filter,
T *  hmass,
T *  hmass_obj,
TrigObjectMatcher tom = 0 
) const
inlineprotected

Definition at line 138 of file TagNProbe.h.

143  {
144  return selection( troi, proi, selector, filter, selector, filter, hmass, hmass_obj, tom, tom );
145  }

◆ selection() [2/2]

template<typename T >
bool TagNProbe::selection ( const TIDA::Roi troi,
const TIDA::Roi proi,
const TrackSelector selector_tag,
TrackFilter filter_tag,
const TrackSelector selector_probe,
TrackFilter filter_probe,
T *  hmass,
T *  hmass_obj,
TrigObjectMatcher tom_tag = 0,
TrigObjectMatcher tom_probe = 0 
) const
inlineprotected

get reference tracks from the tag roi

get reference tracks from the probe roi

loop over tag ref tracks

loop over probe ref tracks

check compatibility of the track z and invariant mass ...

Definition at line 148 of file TagNProbe.h.

156  {
157 
159  TIDARoiDescriptor roi_tag( troi.roi() );
160 
161  dynamic_cast<Filter_Combined*>(filter_tag)->setRoi( &roi_tag );
162 
163  std::vector<TIDA::Track*> refp_tag = selector_tag->tracks( filter_tag );
164 
166 
167  TIDARoiDescriptor roi_probe( proi.roi() );
168 
169  dynamic_cast<Filter_Combined* >( filter_probe )->setRoi( &roi_probe );
170 
171  std::vector<TIDA::Track*> refp_probe = selector_probe->tracks( filter_probe );
172 
174  bool found = false;
175 
176  for ( size_t it=0; it<refp_tag.size() ; it++ ) {
177 
179  for ( size_t ip=0; ip<refp_probe.size() ; ip++ ) {
180 
182  double invmass = mass( refp_tag[it], refp_probe[ip] );
183  double invmass_obj = mass_obj( refp_tag[it], refp_probe[ip], tom_tag, tom_probe );
184  double deltaz0 = std::fabs(refp_tag[it]->z0() - refp_probe[ip]->z0() );
185 
186  if ( invmass_obj>m_massMin && invmass_obj<m_massMax && deltaz0<5 ) {
187  hmass->Fill( invmass );
188  hmass_obj->Fill( invmass_obj );
189  found = true;
190  }
191  }
192  }
193 
194  return found;
195 
196  }

◆ tag() [1/2]

const std::string& TagNProbe::tag ( ) const
inline

Definition at line 48 of file TagNProbe.h.

48 { return m_tagChainName; }

◆ tag() [2/2]

void TagNProbe::tag ( const std::string &  chainName)
inline

getters and setters

could be moved to the constructor now ...

Definition at line 45 of file TagNProbe.h.

◆ type0()

const std::string& TagNProbe::type0 ( ) const
inline

Definition at line 51 of file TagNProbe.h.

51 { return m_particleType0; };

◆ type1()

const std::string& TagNProbe::type1 ( ) const
inline

Definition at line 52 of file TagNProbe.h.

52 { return m_particleType1; };

Member Data Documentation

◆ m_mass0

double TagNProbe::m_mass0
private

Definition at line 210 of file TagNProbe.h.

◆ m_mass1

double TagNProbe::m_mass1
private

Definition at line 211 of file TagNProbe.h.

◆ m_massMax

double TagNProbe::m_massMax
private

Definition at line 214 of file TagNProbe.h.

◆ m_massMin

double TagNProbe::m_massMin
private

Definition at line 213 of file TagNProbe.h.

◆ m_particleType0

std::string TagNProbe::m_particleType0
private

Definition at line 207 of file TagNProbe.h.

◆ m_particleType1

std::string TagNProbe::m_particleType1
private

Definition at line 208 of file TagNProbe.h.

◆ m_probeChainName

std::string TagNProbe::m_probeChainName
private

Definition at line 218 of file TagNProbe.h.

◆ m_tagChainName

std::string TagNProbe::m_tagChainName
private

Definition at line 219 of file TagNProbe.h.

◆ m_unique

bool TagNProbe::m_unique
private

Definition at line 216 of file TagNProbe.h.


The documentation for this class was generated from the following files:
TIDA::Roi::roi
const TIDARoiDescriptor & roi() const
access the roi information
Definition: TIDARoi.h:42
TagNProbe::selection
bool selection(const TIDA::Roi &troi, const TIDA::Roi &proi, const TrackSelector *selector, TrackFilter *filter, T *hmass, T *hmass_obj, TrigObjectMatcher *tom=0) const
Definition: TagNProbe.h:138
TagNProbe::probe
const std::string & probe() const
Definition: TagNProbe.h:49
TagNProbe::tag
const std::string & tag() const
Definition: TagNProbe.h:48
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TIDA::Chain::size
unsigned size() const
number of rois
Definition: TIDAChain.h:54
TagNProbe::m_particleType1
std::string m_particleType1
Definition: TagNProbe.h:208
TIDARoiDescriptor
Describes the Region of Ineterest geometry It has basically 8 parameters.
Definition: TIDARoiDescriptor.h:42
TIDA::Chain::rois
const std::vector< TIDA::Roi > & rois() const
get back roi vector
Definition: TIDAChain.h:50
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TagNProbe::m_particleType0
std::string m_particleType0
Definition: TagNProbe.h:207
TagNProbe::construct
void construct()
Definition: TagNProbe.cxx:42
TagNProbe::pt
double pt(const TIDA::Track *t) const
Definition: TagNProbe.h:124
covarianceTool.filter
filter
Definition: covarianceTool.py:514
TagNProbe::findChain
TIDA::Chain * findChain(const std::string &chainname, std::vector< TIDA::Chain > &chains) const
Definition: TagNProbe.cxx:92
TagNProbe::m_mass0
double m_mass0
Definition: TagNProbe.h:210
TagNProbe::m_unique
bool m_unique
Definition: TagNProbe.h:216
TagNProbe::m_massMin
double m_massMin
Definition: TagNProbe.h:213
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigObjectMatcher::status
bool status() const
Definition: TrigObjectMatcher.h:67
TagNProbe::m_probeChainName
std::string m_probeChainName
Definition: TagNProbe.h:218
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
TrackSelector::tracks
const std::vector< TIDA::Track * > & tracks() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Filter_Combined
Definition: Filters.h:225
TIDA::Chain
Definition: TIDAChain.h:28
TIDA::Roi
Definition: TIDARoi.h:31
python.copyTCTOutput.chains
chains
Definition: copyTCTOutput.py:81
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
TagNProbe::GetRois
std::vector< TIDA::Roi * > GetRois(std::vector< TIDA::Chain > &chains, const TrackSelector *selector, TrackFilter *filter, T *hmass, T *hmass_obj, TrigObjectMatcher *tom=0) const
Definition: TagNProbe.h:60
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
TagNProbe::mass_obj
double mass_obj(const TIDA::Track *t1, const TIDA::Track *t2, TrigObjectMatcher *tom=0) const
Definition: TagNProbe.cxx:58
TagNProbe::m_mass1
double m_mass1
Definition: TagNProbe.h:211
TagNProbe::m_massMax
double m_massMax
Definition: TagNProbe.h:214
TagNProbe::mass
double mass(const T1 *t1, const T2 *t2) const
Definition: TagNProbe.h:128
TagNProbe::m_tagChainName
std::string m_tagChainName
Definition: TagNProbe.h:219
TrigObjectMatcher::object
const TrackTrigObject * object(unsigned long track_id)
Definition: TrigObjectMatcher.h:61