114{
115 bool decay = (pMc->
daughterList()).size()==0?
false:
true;
116
117 SmartDataPtr<Event::MdcMcHitCol> mdcMcHitCol(eventSvc(), "/Event/MC/MdcMcHitCol");
118 SmartDataPtr<Event::TofMcHitCol> tofMcHitCol(eventSvc(), "/Event/MC/TofMcHitCol");
119 SmartDataPtr<Event::EmcMcHitCol> emcMcHitCol(eventSvc(), "/Event/MC/EmcMcHitCol");
120 SmartDataPtr<Event::MucMcHitCol> mucMcHitCol(eventSvc(), "/Event/MC/MucMcHitCol");
121
123 {
124 os.setf(ios::left);
125 map<int,string>::iterator iter_map;
127 if(iter_map!=map_pid.end())
128 {
129 if(m_OutputLevel==1)
130 {
131 string name = iter_map->second;
133 HepLorentzVector p4 = (pMc)->initialFourMomentum();
134 os<<" "<<"["<<setw(12)<<p4.vect().cosTheta()<<setw(12)<<p4.vect().phi()<<"] ";
135 os<<"["<<setw(12)<<p4.x()<<setw(12)<<p4.y()
136 <<setw(12)<<p4.z()<<" "<<setw(10)<<p4.t()<<"] ";
137
139 os<<"["<<setw(12)<<ipst.x();
140 os<<setw(12)<<ipst.y();
141 os<<setw(10)<<ipst.z()<<"] ";
142
143 HepLorentzVector fpst = (pMc)->finalPosition();
144 os<<"["<<setw(12)<<fpst.x();
145 os<<setw(12)<<fpst.y();
146 os<<setw(10)<<fpst.z()<<"] ";
147 os<<endl;
148 }
149 if(m_OutputLevel==2)
150 {
153 }
154
155 }
156 }
157 if(decay)
158 {
159 SmartRefVector<Event::McParticle>::const_iterator begin = (pMc->
daughterList()).begin();
160 SmartRefVector<Event::McParticle>::const_iterator end = (pMc->
daughterList()).end();
161 SmartRefVector<Event::McParticle>::const_iterator it;
162 for(it = begin;it != end;it++)
163 {
164 m_trkIndex = (*it)->trackIndex();
165 map<int,string>::iterator
iter;
166 iter = map_pid.find((*it)->particleProperty());
167 if(
iter!=map_pid.end())
168 {
169 daughters =
iter->second;
170 if(m_OutputLevel ==1)
171 {
172 os.setf(ios::left);
173 os<<"["<<m_trkIndex<<"]"<<setw(20)<<daughters<<endl;
174
175 HepLorentzVector p4 = (*it)->initialFourMomentum();
176 os<<" "<<"["<<setw(12)<<p4.vect().cosTheta()<<setw(12)<<p4.vect().phi()<<"] ";
177 os<<"["<<setw(12)<<p4.x()<<setw(12)<<p4.y()
178 <<setw(12)<<p4.z()<<" "<<setw(10)<<p4.t()<<"] ";
179
180
181 HepLorentzVector ipst = (*it)->initialPosition();
182 os<<"["<<setw(12)<<ipst.x();
183 os<<setw(12)<<ipst.y();
184 os<<setw(10)<<ipst.z()<<"] ";
185
186
187
188 HepLorentzVector fpst = (*it)->finalPosition();
189 os<<"["<<setw(12)<<fpst.x();
190 os<<setw(12)<<fpst.y();
191 os<<setw(10)<<fpst.z()<<"] ";
192
193 }
194 if(m_OutputLevel==2)
195 {
196 if(((*mdcMcHitCol).size()==0&&(*tofMcHitCol).size()==0&&(*emcMcHitCol).size()==0&&(*mucMcHitCol).size()==0)&&tab==0)
197 os<<" --------------------------------------------------------"<<endl
198 <<" mdcMcHitCol,tofMcHitCol,emcMcHitCol,mucMcHitCol all empty"<<endl
199 <<" --------------------------------------------------------"<<endl;
200 if(!((*mdcMcHitCol).size()==0&&(*tofMcHitCol).size()==0&&(*emcMcHitCol).size()==0&&(*mucMcHitCol).size()==0))
201
202 {
203 os.setf(ios::left);
204 os<<"["<<m_trkIndex<<"]"<<setw(12)<<daughters<<endl;
205 }
206
207 int trkIdx = (*it)->trackIndex();
209 }
210 os<<endl;
211 }
212 else cout<<"can not find the daughter particle in pdt_table"<<endl;
213 }
214 daughters.erase();
215
216 for(it = begin;it != end;it++)
217 {
218 SmartRef<Event::McParticle> pdMc = (*it);
220 }
221 }
222}
bool primaryParticle() const
Retrieve whether this is a primary particle.
const HepLorentzVector & initialPosition() const
Retrieve pointer to the start, end vertex positions.
const SmartRefVector< McParticle > & daughterList() const
access the process name
StdHepId particleProperty() const
Retrieve particle property.
void printHit(ofstream &, Event::MdcMcHitCol &, Event::TofMcHitCol &, Event::EmcMcHitCol &, Event::MucMcHitCol &, int &)