| 20 |
if (event->GetTrkLevel2()->GetNTracks() == 0) |
if (event->GetTrkLevel2()->GetNTracks() == 0) |
| 21 |
return; |
return; |
| 22 |
|
|
| 23 |
// Reload the TRK parameters only if they have been changed (ie., if another instance of |
// Reload the TRK alignment parameters only if they have been changed (ie., if another instance of |
| 24 |
// this class used a different set of parameters). |
// this class used a different set of parameters). |
| 25 |
if (_trkParamsFile != _currTrkParamsFile) { |
if (_trkParamsFile != _currTrkParamsFile) { |
| 26 |
TrkParams::Set(_trkParamsFile, 5); |
TrkParams::Set(_trkParamsFile, 5); |
| 33 |
if (!trkTrack) |
if (!trkTrack) |
| 34 |
return; |
return; |
| 35 |
|
|
| 36 |
|
// Check if good clusters have meaningful energy releases |
| 37 |
|
for (UInt_t ip = 0; ip < 6; ip++) { |
| 38 |
|
if (trkTrack->XGood(ip) == 1 && trkTrack->GetDEDX(ip, 0) <= 0.) |
| 39 |
|
trkTrack->xgood[ip] = 0; // Set it to bad |
| 40 |
|
if (trkTrack->YGood(ip) == 1 && trkTrack->GetDEDX(ip, 1) <= 0.) |
| 41 |
|
trkTrack->ygood[ip] = 0; // Set it to bad |
| 42 |
|
} |
| 43 |
|
|
| 44 |
if (_currEvent != event->GetReadEntry()) { |
if (_currEvent != event->GetReadEntry()) { |
| 45 |
// Saves the original track data if the current event (recorded in the static member _currEvent) is |
// Saves the original track data if the current event (recorded in the static member _currEvent) is |
| 46 |
// different from the actually processed event. This way, multiple instances of the class |
// different from the actually processed event. This way, multiple instances of the class |
| 48 |
_currEvent = event->GetReadEntry(); |
_currEvent = event->GetReadEntry(); |
| 49 |
// Save the original cluster status and measured positions |
// Save the original cluster status and measured positions |
| 50 |
for (int i = 0; i < 6; i++) { |
for (int i = 0; i < 6; i++) { |
| 51 |
_layerXBackup[i] = trkTrack->xgood[0]; |
_layerXBackup[i] = trkTrack->xgood[i]; |
| 52 |
_layerYBackup[i] = trkTrack->ygood[0]; |
_layerYBackup[i] = trkTrack->ygood[i]; |
| 53 |
_xmBackup[i] = trkTrack->xm[i]; |
_xmBackup[i] = trkTrack->xm[i]; |
| 54 |
_ymBackup[i] = trkTrack->ym[i]; |
_ymBackup[i] = trkTrack->ym[i]; |
| 55 |
} |
} |
| 60 |
for (int i = 0; i < 6; i++) { |
for (int i = 0; i < 6; i++) { |
| 61 |
trkTrack->xm[i] = _xmBackup[i]; |
trkTrack->xm[i] = _xmBackup[i]; |
| 62 |
trkTrack->ym[i] = _ymBackup[i]; |
trkTrack->ym[i] = _ymBackup[i]; |
| 63 |
_layerXBackup[i] = trkTrack->xgood[0]; |
trkTrack->xgood[i] = _layerXBackup[i]; |
| 64 |
_layerYBackup[i] = trkTrack->ygood[0]; |
trkTrack->ygood[i] = _layerYBackup[i]; |
| 65 |
} |
} |
| 66 |
|
|
| 67 |
} |
} |
| 68 |
|
|
| 69 |
// Apply the gaussian spread |
// Apply the gaussian spread |
| 70 |
|
|
| 71 |
cout << GetName() << " " << trkTrack->xm[0]; |
if (_spreadX != 0.) { |
| 72 |
cout.flush(); |
for (Int_t ip = 0; ip < 6; ip++) { |
| 73 |
for (Int_t ip = 0; ip < 6; ip++) { |
// gaussian distributed random number Gauss(mean,sigma) (in cm) |
| 74 |
// gaussian distributed random number Gauss(mean,sigma) (in cm) |
trkTrack->xm[ip] += _r3->Gaus(0., _spreadX); |
| 75 |
trkTrack->xm[ip] += _r3->Gaus(0., _spreadX); |
} |
|
trkTrack->ym[ip] += _r3->Gaus(0., _spreadY); |
|
| 76 |
} |
} |
| 77 |
cout << GetName() << " " << trkTrack->xm[0] << endl; |
if (_spreadY != 0.) { |
| 78 |
|
for (Int_t ip = 0; ip < 6; ip++) { |
| 79 |
|
trkTrack->ym[ip] += _r3->Gaus(0., _spreadY); |
| 80 |
|
} |
| 81 |
|
} |
| 82 |
|
|
| 83 |
// Mask the layers |
// Mask the layers |
| 84 |
if (_maskedViews) { |
if (_maskedViews) { |
| 85 |
if ((_maskedViews & T1X) == T1X) |
if ((_maskedViews & T1X) == T1X) |