170 std::map<int, std::vector<int> > mcHitMap;
171 std::map<int, std::vector<int> > trackToTrackCandMap;
173 std::vector<PndRiemannTrack> riemannTracks;
174 std::vector<int> MCTrackOrderRiemann;
176 TVector3 MCPos, RecoPos;
178 double TrackP, TrackPt;
186 std::cout <<
"------------Event " <<
fEventNr <<
"-------------" << std::endl;
191 for (
std::map<
int, std::vector<int> >::const_iterator kIt = mcHitMap.begin(); kIt!= mcHitMap.end(); kIt++){
193 std::vector<int> MChits = kIt->second;
199 std::cout <<
"<<<<<<<<<<< MCTrack >>>>>>>>>> " << std::endl;
200 myTrack->
Print(kIt->first);
202 std::cout <<
"Pt: " << TrackPt <<
" GeV/c; P: " << TrackP <<
" GeV/c" << std::endl;
203 std::cout <<
"StartVertex: " << startVertex.X() <<
" " << startVertex.Y() <<
" " << startVertex.Z() << std::endl;
205 for (
unsigned int p = 0;
p < MChits.size();
p++){
208 std::cout <<
"-------------------------------" << std::endl;
212 MCEnergy = myPoint->GetEnergyLoss()*10E9;
215 std::vector<int> pixCluster =
GetClusters(MChits[p],
true);
217 for (
unsigned int clInd = 0; clInd < pixCluster.size(); clInd++) {
221 int recoHit =
GetRecoHit(pixCluster[clInd],
true);
228 std::cout <<
"-W- No Reco Hit found!" << std::endl;
233 std::vector<int> stripCluster =
GetClusters(MChits[p],
false);
237 for (
unsigned int clInd = 0; clInd < stripCluster.size(); clInd++) {
242 recoHit =
GetRecoHit(stripCluster[clInd],
false);
245 std::cout <<
"RecoHit: " << recoHit << std::endl;
248 if (oldRecoHit != recoHit){
250 oldRecoHit = recoHit;
258 if ((oldRecoHit > -1) && (oldRecoHit != recoHit))
267 std::cout << std::endl;
268 std::cout <<
"TrackID " << kIt->first <<
": ";
269 for (
unsigned int testInd = 0; testInd < pixHits.size(); testInd++)
270 std::cout <<
" 5/" << pixHits[testInd];
272 for (
unsigned int testInd = 0; testInd < stripHits.size(); testInd++)
273 std::cout <<
" 4/" << stripHits[testInd];
274 std::cout << std::endl;
276 std::cout <<
"MCHitMap: ";
277 for (
unsigned int testInd = 0; testInd < mcHitMap[kIt->first].size(); testInd++)
278 std::cout << mcHitMap[kIt->first].at(testInd) <<
" ";
279 std::cout << std::endl;
281 std::vector<int> matches;
282 std::vector<int> candidates;
284 std::cout <<
"TrackCands for MCTrack: ";
285 for (
unsigned int i = 0;
i < candidates.size();
i++) std::cout << candidates[
i];
286 std::cout << std::endl;
287 trackToTrackCandMap[kIt->first] = candidates;
292 for (
unsigned int i = 0;
i < matches.size();
i++){
293 if (oldmatches < matches[
i]){
294 oldmatches = matches[
i];
299 MCTrackOrderRiemann.push_back(kIt->first);
301 for (UInt_t j = 0; j < myCand->
getNHits(); j++){
302 unsigned int detId, hitId;
303 myCand->
getHit(j, detId, hitId);
308 myRiemannTrack.
refit();
309 myRiemannTrack.
szFit();
310 TVectorD
n = myRiemannTrack.
n();
312 riemannTracks.push_back(myRiemannTrack);
314 double curv = myCand->
getCurv();
315 double dip = myCand->
getDip();
319 unsigned int detId, hitId;
322 myCand->
getHit(0,detId, hitId);
328 myCand->
getHit(0,detId, hitId);
329 std::cout << std::endl;
330 std::cout <<
"HitMatch: " << matches[
i] << std::endl;
331 std::cout <<
"Hits in Track: " << myCand->
getNHits() <<
" Difference: ";
332 if (detId > 0) std::cout << myCand->
getNHits() - matches[
i] << std::endl;
333 else std::cout << myCand->
getNHits() - matches [
i] -1 << std::endl;
336 std::cout <<
"Pt: " << pt <<
" GeV/c " <<
" P: " << pt/dip <<
" GeV/c" << std::endl;
337 std::cout <<
"Pt error: " << TrackPt - pt <<
" P error: " << TrackP - pt/dip << std::endl;
338 std::cout <<
"TrackID: " << kIt->first <<
" mcHitMap.size: " << mcHitMap[kIt->first].size() <<
" matches: " << matches[
i] << std::endl;
339 std::cout <<
"Missing Hits: " << mcHitMap[kIt->first].size() - matches[
i] << std::endl;
340 if (mcHitMap[kIt->first].size() < (myCand->
getNHits()-1))
345 if (mcHitMap[kIt->first].size() > 2){
346 if (mcHitMap[kIt->first].size() > 3){
361 if (matches.size() > 0){
363 double curv = myCand->
getCurv();
364 double dip = myCand->
getDip();
369 fHPRes->Fill(TrackP - pt/dip);
370 fHRiemannRes->Fill(mcHitMap[kIt->first].size() - matches[highestMatch]);
371 if (mcHitMap[kIt->first].size() - matches[highestMatch] == 0)
375 std::cout <<
"Found TracksPerTrack: " << TrackMatch;
376 if (mcHitMap[kIt->first].size() > 2) std::cout <<
" 3Hits+" << std::endl;
380 if (riemannTracks.size() > 1){
381 std::cout << riemannTracks.size() <<
" Riemann Tracks used!" << std::endl;
382 for (
unsigned int i = 0; i < riemannTracks.size() - 1; i++){
383 for (
unsigned int j = i + 1; j < riemannTracks.size(); j++) {
395 std::cout <<
"Vertex Test for: " << MCTrackOrderRiemann[
i] <<
" and " << MCTrackOrderRiemann[j] << std::endl;
396 int result = riemannTracks[
i].calcIntersection(riemannTracks[j], p1, p2);
399 std::cout <<
"Vertex1: " << p1.X() <<
" " << p1.Y() <<
" " << p1.Z() << std::endl;
400 std::cout <<
"Vertex2: " << p2.X() <<
" " << p2.Y() <<
" " << p2.Z() << std::endl;
403 std::cout <<
"MCVertex " << MCTrackOrderRiemann[
i] <<
": "<< MCVertex.X() <<
" " << MCVertex.Y() <<
" " << MCVertex.Z() << std::endl;
404 MCVertex -= (p1+
p2)*0.5;
405 std::cout <<
"Difference: " << MCVertex.X() <<
" " << MCVertex.Y() <<
" " << MCVertex.Z() << std::endl;
416 std::cout << std::endl;
417 std::cout <<
"----Ghost TrackCandidates:-------" << std::endl;
418 for (
unsigned int tcIndex = 0; tcIndex <
fGhostCand.size(); tcIndex++){
426 std::cout << std::endl;
std::vector< Int_t > GetClusterList() const
TH1 * fHRiemannTracksPerTrackAdd
void PrintRecoHitInfo(int hitInd, int digiSize, TVector3 MCPos, double MCEnergy, bool pixel) const
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
FairHit * GetFairHit(Int_t detId, Int_t hitId)
std::map< int, std::vector< int > > AssignHitsToTracks()
unsigned int getNHits() const
TVector3 GetMomentum() const
TVector3 GetPositionOut() const
TH1 * fHRiemannVertexResolutionY
TH1 * fHDigisPerClusterStrip
void PrintTrackCand(GFTrackCand *cand) const
TString pt(TString pts, TString exts="px py pz")
const TVectorD & n() const
std::vector< int > fGhostCand
std::map< int, std::vector< int > > fTrackPixHitIdMap
TClonesArray * fStripCluster
void getHit(unsigned int i, unsigned int &detId, unsigned int &hitId) const
Get detector ID and cluster index (hitId) for hit number i.
std::map< int, std::vector< int > > fTrackStripHitIdMap
void refit(bool withErrorCalc=true)
void Print(Int_t iTrack=0) const
Track candidate – a list of cluster indices.
TH1 * fHRiemannTracksPerTrack
void PrintClusterDigiInfo(int clIndex, std::vector< Int_t > digiInd, bool pixel)
TClonesArray * fTrackCand
std::vector< int > GetClusters(int MCHit, bool pixel)
TH1 * fHRiemannVertexResolutionZ
TVector3 GetPosition() const
void GetTrackCandsForMCTrack(std::vector< int > pixHitId, std::vector< int > stripHitId, std::vector< int > &matches, std::vector< int > &result)
void szFit(bool withErrorCalc=true)
void addHit(PndRiemannHit &hit)
TVector3 GetStartVertex() const
TH1 * fHRiemannVertexResolutionX
Int_t GetMotherID() const
int GetRecoHit(int clIndex, bool pixel) const
TClonesArray * fPixCluster
int fNNotFoundPossibleTracks
virtual void Print(const Option_t *opt=0) const