/[PAMELA software]/PamCut/CollectionActions/ReprocessTrackAction/ReprocessTrackAction.cpp
ViewVC logotype

Diff of /PamCut/CollectionActions/ReprocessTrackAction/ReprocessTrackAction.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.3 by pam-fi, Wed Nov 30 16:57:49 2011 UTC revision 1.3 by pam-fi, Thu Jul 8 14:00:28 2010 UTC
# Line 11  void ReprocessTrackAction::OnGood(PamLev Line 11  void ReprocessTrackAction::OnGood(PamLev
11    
12    _allEvents++;    _allEvents++;
13    
14    TrkLevel1 *L1 = NULL;    TrkLevel1 *L1;
15    if (_newTrkL1) {    if (_newTrkL1)
16      if (_externalFlag)      if (_externalFlag)
17        if (!(*_externalFlag))        if (!(*_externalFlag))
18          return;          return;
# Line 20  void ReprocessTrackAction::OnGood(PamLev Line 20  void ReprocessTrackAction::OnGood(PamLev
20          L1 = *_newTrkL1; // External L1 plus flag=true          L1 = *_newTrkL1; // External L1 plus flag=true
21      else      else
22        L1 = *_newTrkL1; // External L1 plus no external flag        L1 = *_newTrkL1; // External L1 plus no external flag
   
     // Set the new L1 inside PamLevel2 event  
     TrkLevel1 *oldTrkL1 = event->GetTrkLevel1();  
   
     // Sadly, there's no copy constructor for TrkLevel1. We have to copy manually...  
     // TODO: replace the following with TrkLevel1 copy constructor (if there will ever be one...)  
     // 1. Clean the structure  
     oldTrkL1->Set(); // Creates Cluster array if it doesn't exist  
     Int_t nClus = oldTrkL1->Cluster->GetEntries();  
     for (Int_t i = 0; i < nClus; i++) {  
       TrkCluster *clstrPtr = (TrkCluster*) (oldTrkL1->Cluster->UncheckedAt(i));  
       if (clstrPtr) {  
         delete[] clstrPtr->clsignal;  
         clstrPtr->clsignal = NULL;  
         delete[] clstrPtr->clsigma;  
         clstrPtr->clsigma = NULL;  
         delete[] clstrPtr->cladc;  
         clstrPtr->cladc = NULL;  
         delete[] clstrPtr->clbad;  
         clstrPtr->clbad = NULL;  
       }  
     }  
     oldTrkL1->Cluster->Clear("C");  
   
     // 2. Copy the new L1 into the old one  
     // 2.1 Fixed size public arrays  
     for (int i = 0; i < 12; i++) {  
       oldTrkL1->good[i] = (*_newTrkL1)->good[i];  
       for (int j = 0; j < 24; j++) {  
         oldTrkL1->cn[j][i] = (*_newTrkL1)->cn[j][i];  
         oldTrkL1->cnn[j][i] = (*_newTrkL1)->cnn[j][i];  
       }  
     }  
     // 2.2 TClonesArray of TrkCluster objects  
     int nClusters = (*_newTrkL1)->Cluster->GetEntries();  
     for (int i = 0; i < nClusters; i++) {  
       TrkCluster *currCluster = (TrkCluster*) ((*_newTrkL1)->Cluster->At(i));  
       new ((*(oldTrkL1->Cluster))[i]) TrkCluster(*currCluster);  
     }  
   }  
23    else {    else {
24        L1 = (TrkLevel1*) event->GetPointerTo("TrkLevel1"); // Internal L1
     event->GetPointerTo("TrkLevel1"); // Internal L1 (create it if it doesn't exist)  
25      TrkLevel0 *L0 = event->GetTrkLevel0();      TrkLevel0 *L0 = event->GetTrkLevel0();
26      if (!L0) {      if (!L0) {
27        cout << "Missing TrkLevel0 event " << endl;        cout << "Missing TrkLevel0 event " << endl;
28        return;        return;
29      }      }
30      L0->ProcessEvent(); // re-processing level0->level1      L0->ProcessEvent();// re-processing level0->level1
31      L1 = event->GetTrkLevel1();      L1 = event->GetTrkLevel1();
32      L1->Clear();      L1->Clear();
33      L1->SetFromLevel1Struct();      L1->SetFromLevel1Struct();
# Line 83  void ReprocessTrackAction::OnGood(PamLev Line 42  void ReprocessTrackAction::OnGood(PamLev
42    
43      // Reprocess      // Reprocess
44      _reprocessed++;      _reprocessed++;
45      L1->ProcessEvent(); // re-processing level1->level2      L1->ProcessEvent();// re-processing level1->level2
46    
47      trkl2 = event->GetTrkLevel2();      trkl2 = event->GetTrkLevel2();
48      trkl2->Clear();      trkl2->Clear();

Legend:
Removed from v.1.2.2.3  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23