00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 struct HIT
00012 {
00013 Float_t x,y,z;
00014 Float_t rad,phi;
00015 Float_t raderror,phierror;
00016 };
00017
00018 struct CLUSTER
00019 {
00020 Float_t timepos,padpos,timesigma,padsigma;
00021 Float_t peakheight, charge;
00022 Int_t timebin,pad;
00023 Int_t padlength,timelength;
00024 Int_t row,sec;
00025 Int_t flag;
00026 Int_t numpeaks;
00027 };
00028
00029 struct EVENT
00030 {
00031 Float_t run;
00032 Int_t nevent;
00033 };
00034
00035 struct TEVENT
00036 {
00037 Float_t run;
00038 Int_t nevent;
00039 };
00040
00041
00042 struct TCLUSTER
00043 {
00044 Int_t row,sec, padlength, timelength;
00045 Float_t peakheight, charge;
00046 Int_t ntracks;
00047 Float_t padpos, timepos;
00048 Float_t padpossigma, timepossigma;
00049 };
00050
00051 struct THIT
00052 {
00053 Float_t x,y,z;
00054 Float_t ex,ey,ez;
00055 Float_t globResX,globResY,globResPhi,globResR;
00056 Float_t primResX,primResY,primResPhi,primResR;
00057 };
00058
00059 struct TREVENT
00060 {
00061 Float_t run;
00062 Int_t nevent;
00063 };
00064
00065 struct TRACK
00066 {
00067 Float_t px,py,pz;
00068 Float_t eta,p,pt;
00069 Int_t npoints;
00070 Int_t charge;
00071 Int_t type;
00072 Int_t sec;
00073 };
00074
00075 struct MVERTEX
00076 {
00077 Float_t x,y,z;
00078 };
00079
00080 CLUSTER cluster;
00081 HIT hit;
00082 TCLUSTER tcluster;
00083 THIT thit;
00084 TRACK track;
00085 EVENT event;
00086 TEVENT tevent;
00087 TREVENT trevent;
00088 MVERTEX mvertex;
00089
00090
00091 void print_TCluster(TString eingabe)
00092 {
00093
00094 TBranch *bhit, *bevent, *bcluster;
00095 TBranch *bthit, *btcluster, *btevent;
00096 TBranch *btrevent, *btrack,*btrvertex;
00097 TDirectory *histdir, *vertexdir;
00098
00099 TTree *dtree;
00100 TTree *dttree;
00101 TTree *dtrtree;
00102
00103
00104 cout<<"Clusters on Tracks Analysis started..."<<endl;
00105 cout<<endl;
00106
00107 TFile *f=new TFile(eingabe+".root");
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 dtrtree=(TTree*) f->Get("tr");
00123 btrevent=dtrtree->GetBranch("event");
00124 btrevent->SetAddress(&trevent);
00125 btrack=dtrtree->GetBranch("track");
00126 btrack->SetAddress(&track);
00127 btrvertex=dtrtree->GetBranch("vertex");
00128 btrvertex->SetAddress(&mvertex);
00129
00130 dttree=(TTree*) f->Get("clot");
00131 btcluster=dttree->GetBranch("cluster");
00132 btcluster->SetAddress(&tcluster);
00133 bthit=dttree->GetBranch("hit");
00134 bthit->SetAddress(&thit);
00135 btevent=dttree->GetBranch("event");
00136 btevent->SetAddress(&tevent);
00137
00138 Int_t maxentries1 = (Int_t)btcluster->GetEntries();
00139 cout<<"Process Cluster-on-Track-Tree with "<<maxentries1<<" clusters..."<<endl;
00140
00141 cout<<endl;
00142
00143 Int_t i=0;
00144 Int_t ntracksold=0;
00145 Int_t ntrack=0;
00146 Int_t nevent=0;
00147
00148 for (int k=0;k<=maxentries1;k++)
00149 {
00150 btcluster->GetEntry(k);
00151 bthit->GetEntry(k);
00152 btevent->GetEntry(k);
00153 if (nevent==0){
00154 nevent = tevent.nevent;
00155 cout<<endl;
00156 cout<<"Event "<<nevent<<endl;
00157 }
00158
00159 if (tevent.nevent != nevent)
00160 {
00161 if (i==0) break;
00162 nevent = tevent.nevent;
00163 cout<<endl;
00164 cout<<"Event "<<nevent<<endl;
00165 }
00166 if (tevent.nevent==nevent)
00167 {
00168 if (tcluster.ntracks != ntracksold)
00169 {
00170 cout<<endl;
00171 ntrack++;
00172 i=0;
00173 }
00174 cout<<"ntrack = "<<tcluster.ntracks<<" cluster "<<i<<" padpos "<<tcluster.padpos<<" timepos "<<tcluster.timepos<<" x,y,z = "<<thit.x<<" "<<thit.y<<" "<<thit.z<<endl;
00175
00176 i++;
00177
00178 ntracksold=tcluster.ntracks;
00179 }
00180 }
00181
00182 }
00183