FairRoot/PandaRoot
PndTrkIndivisibleHit.cxx
Go to the documentation of this file.
1 //
2 // PndTrkIndivisibleHit.cxx
3 //
4 // Class for pattern recognition combined hit:
5 // the hit is obtained combining indivisible
6 // hits and its position is obtained calculating
7 // the center of mass.
8 //
9 // authors: Lia Lavezzi - INFN Pavia (2012)
10 //
11 
12 #include "PndTrkIndivisibleHit.h"
13 
14 #include "PndDetectorList.h"
15 
16 #include <iostream>
17 
18 // ROOT
19 #include "TArc.h"
20 #include "TMarker.h"
21 #include "TMath.h"
22 
23 using namespace std;
24 
25 // Bool_t PndTrkIndivisibleHit::operator==(const PndTrkIndivisibleHit &hit1) {
26 // return fDetectorID == hit1.fDetectorID && fHitID == hit1.fHitID;
27 // }
28 
29 // Bool_t PndTrkIndivisibleHit::operator<(const PndTrkIndivisibleHit &hit1) {
30 // return fSortVariable < hit1.fSortVariable;
31 // }
32 
33 
35 
36 PndTrkIndivisibleHit::PndTrkIndivisibleHit(TArrayI hitids, TVector3 &pos) : PndTrkHit(-1, -1, kFALSE, INDIVISIBLE, -1, pos, -1, pos.Mag()), fHitIDs(hitids) {}
37 
38 
40  fHitIDs = TArrayI(hit.fHitIDs);
41 }
42 
44  fHitIDs.Reset();
45 }
46 
47 // Int_t PndTrkIndivisibleHit::Compare(const TObject *hit) const {
48 // // Compare abstract method. Must be overridden if a class wants to be able
49 // // to compare itself with other objects. Must return -1 if this is smaller
50 // // than obj, 0 if objects are equal and 1 if this is larger than obj.
51 // if(fSortVariable < ((PndTrkIndivisibleHit*) hit)->fSortVariable) return -1;
52 // else if(fSortVariable == ((PndTrkIndivisibleHit*) hit)->fSortVariable) return 0;
53 // else return 1;
54 // }
55 
56 
57 
58 void PndTrkIndivisibleHit::Draw(Color_t color) {
59 
60  TMarker *mrk = new TMarker(fPosition.X(), fPosition.Y(), 1);
61  mrk->SetMarkerColor(color);
62  mrk->SetMarkerStyle(20);
63  mrk->Draw("SAME");
64 
65 }
66 
67 
68 
70 
71  cout << "###############################" << endl;
72  cout << "hitIDs: ";
73  for(int ihit = 0; ihit < fHitIDs.GetSize(); ihit++) cout << " " << fHitIDs.At(ihit);
74  cout << endl;
75  fPosition.Print();
76 
77 }
78 
79 
TVector3 pos
#define INDIVISIBLE
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
TVector3 fPosition
Definition: PndTrkHit.h:102
ClassImp(PndAnaContFact)
void Draw(Color_t color)