7 #include "FairLogger.h"
8 #include "TClonesArray.h"
18 list<Int_t> muchPoints[4][3];
19 list<Int_t> trdPoints[4];
25 FairRootManager* ioman = FairRootManager::Instance();
27 if (0 == ioman) LOG(fatal) <<
"No FairRootManager";
29 fMCTracks =
static_cast<TClonesArray*
>(ioman->GetObject(
"MCTrack"));
30 fMuchPoints =
static_cast<TClonesArray*
>(ioman->GetObject(
"MuchPoint"));
31 fTrdPoints =
static_cast<TClonesArray*
>(ioman->GetObject(
"TrdPoint"));
34 LOG(fatal) <<
"No MC tracks or points";
38 for (
int i = 0;
i < 4; ++
i) {
39 for (
int j = 0; j < 3; ++j) {
40 sprintf(buf,
"noise_e_x_%d_%d",
i, j);
41 xHistos[
i][j] =
new TH1F(buf, buf, 240, -30., 30.);
42 sprintf(buf,
"noise_e_y_%d_%d",
i, j);
43 yHistos[
i][j] =
new TH1F(buf, buf, 240, -30., 30.);
47 for (
int i = 1;
i < 4; ++
i) {
48 sprintf(buf,
"trdDeltaThetaX_%d",
i);
50 sprintf(buf,
"trdDeltaThetaY_%d",
i);
58 map<Int_t, LxStatTrack> eNoiseTracks;
61 for (Int_t
i = 0;
i < nofMuchPoints; ++
i) {
67 Int_t trackId = point->GetTrackID();
68 map<Int_t, LxStatTrack>::iterator trIt = eNoiseTracks.find(trackId);
70 if (trIt == eNoiseTracks.end()) eNoiseTracks[trackId] =
LxStatTrack();
72 eNoiseTracks[trackId].muchPoints[stationNumber][layerNumber].push_back(
i);
75 for (Int_t
i = 0;
i < nofMuchPoints; ++
i) {
81 Int_t trackId = point->GetTrackID();
91 while (parentId >= 0) {
94 const list<Int_t> parentPts =
95 eNoiseTracks[parentId].muchPoints[stationNumber][layerNumber];
97 for (list<Int_t>::const_iterator j = parentPts.begin();
100 Int_t parentPtId = *j;
103 Double_t pX = (parentPt->
GetXIn() + parentPt->
GetXOut()) / 2;
104 Double_t pY = (parentPt->
GetYIn() + parentPt->
GetYOut()) / 2;
105 xHistos[stationNumber][layerNumber]->Fill(
x - pX);
106 yHistos[stationNumber][layerNumber]->Fill(
y - pY);
114 map<Int_t, LxStatTrack> jPsiMuTracks;
117 for (Int_t
i = 0;
i < nofTrdPoints; ++
i) {
121 Int_t trackId = point->GetTrackID();
129 if (0 > motherId)
continue;
136 map<Int_t, LxStatTrack>::iterator trIt = jPsiMuTracks.find(trackId);
138 if (trIt == jPsiMuTracks.end()) jPsiMuTracks[trackId] =
LxStatTrack();
140 jPsiMuTracks[trackId].
trdPoints[layerNumber].push_back(
i);
143 for (map<Int_t, LxStatTrack>::const_iterator
i = jPsiMuTracks.begin();
144 i != jPsiMuTracks.end();
148 for (
int j = 1; j < 4; ++j) {
149 const list<Int_t>& lPoints = track.
trdPoints[j - 1];
150 const list<Int_t>& rPoints = track.
trdPoints[j];
152 for (list<Int_t>::const_iterator k = rPoints.begin(); k != rPoints.end();
159 Double_t rTx = rX / rZ;
160 Double_t rTy = rY / rZ;
162 for (list<Int_t>::const_iterator l = lPoints.begin();
170 Double_t deltaZ = lZ - rZ;
171 Double_t
x = rX + rTx * deltaZ;
172 Double_t
y = rY + rTy * deltaZ;
182 TFile* curFile = TFile::CurrentFile();
184 sprintf(name,
"%s.root",
h->GetName());
185 TFile fh(name,
"RECREATE");
189 TFile::CurrentFile() = curFile;
193 for (
int i = 0;
i < 4; ++
i) {
194 for (
int j = 0; j < 3; ++j) {
200 for (
int i = 0;
i < 3; ++
i) {