primaryTrackParticle() Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of information) to the primary TrackParticle corresponding to the MuonType of this muon. This is determined in the following order:
primaryTrackParticle() Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of information) to the primary TrackParticle corresponding to the MuonType of this muon. This is determined in the following order:
55 {
56
58 {
61 case 2:
m_inputTracks =
"MuonSpectrometerTrackParticles" ;
break;
63 }
64
65
66
69
70
74
75
78 outputMuons->setStore( outputAuxMuons );
79
80
81
84 outputTracks->setStore( outputAuxTracks );
85
86
87
90
91
92 ConstDataVector<CELLCONTAINER>* outputCells =
new ConstDataVector<CELLCONTAINER>(
SG::VIEW_ELEMENTS );
94
95
96 ConstDataVector<CELLCONTAINER>* tmpCells =
new ConstDataVector<CELLCONTAINER>(
SG::VIEW_ELEMENTS );
97
98
99 const int Ncut=7;
101 for(
int i = 0;
i < Ncut; ++
i) cut[i] = 0;
102
103
104
107 for(; muonItr != muonEnd; ++muonItr ){
110
111 if(
m_useCuts &&
muon->muonType()!=xAOD::Muon::Combined )
continue;
113
116
120 {
121
124
125 }
127
128
129
136 const TRACK* muon_track = 0;
138 {
139 case 0: muon_track =
muon->trackParticle(xAOD::Muon::CombinedTrackParticle);
break;
140 case 1: muon_track =
muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
break;
141 case 2: muon_track =
muon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
break;
142 default: muon_track =
muon->primaryTrackParticle();
break;
143 }
144 if(!muon_track) continue;
146
147
148
149 double Econe=0.;
152 for(; trackItr != trackEnd; ++trackItr ){
154 if(muon_track==
track)
continue;
155 double dif_eta = muon_track->
eta() -
track->eta();
156 double dif_phi = muon_track->
phi() -
track->phi();
157 if(dif_phi<0) dif_phi=-dif_phi;
158 if(dif_phi>
M_PI){dif_phi=2*
M_PI-dif_phi;}
159 double deltaR = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
161 }
164
165
169 }
170
171
172
175 ASSOCCONTAINER::iterator assocItr = muonCells->begin();
176
177
178 muonItr = outputMuons->
begin();
179 muonEnd = outputMuons->
end();
180 for(; muonItr != muonEnd; ++muonItr ){
182
189 const TRACK* muon_track = 0;
191 {
192 case 0: muon_track =
muon->trackParticle(xAOD::Muon::CombinedTrackParticle);
break;
193 case 1: muon_track =
muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
break;
194 case 2: muon_track =
muon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
break;
195 default: muon_track =
muon->primaryTrackParticle();
break;
196 }
197 if(!muon_track) continue;
198
199
203
206
207
210 for( ;cellItr != cellEnd; ++cellItr){
213 while(i!=outputCells->size()){
if(outputCells->
at(i)==cell){
break;}
i++;}
214 if(i==outputCells->size()){
216 }
217 assocItr->push_back(i);
218 }
219 ++assocItr;
220 }
221
222
223
225 ATH_MSG_DEBUG(
"Number of selected cells: " << outputCells->size());
226
231
232 delete tmpCells;
233 return StatusCode::SUCCESS;
234}
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define CHECK(...)
Evaluate an expression and check for errors.
xAOD::MuonAuxContainer MUONAUXCONTAINER
std::vector< std::vector< int > > ASSOCCONTAINER
#define ASSOCCONTAINER_CONSTRUCTOR(size)
ServiceHandle< StoreGateSvc > & evtStore()
value_type push_back(value_type pElem)
Add an element to the end of the collection.
iterator begin() noexcept
Return an iterator pointing at the beginning of the collection.
iterator end() noexcept
Return an iterator pointing past the end of the collection.
ElementProxy at(size_type n)
Access an element, as an lvalue.
void clear()
Erase all the elements in the collection.
DataModel_detail::const_iterator< DataVector > const_iterator
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void makePrivateStore()
Create a new (empty) private store for this object.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double e() const override final
The total energy of the particle.
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
retrieve(aClass, aKey=None)