]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Updating Event reconstruction for GEANT hit reconstruction in the NewIO
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Sep 2003 17:06:04 +0000 (17:06 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Sep 2003 17:06:04 +0000 (17:06 +0000)
MUON/AliMUONEventReconstructor.cxx
MUON/MUONrecoNtuple.C

index d1025adf685633a2edd836ed91bea3d2ec00c066..af219e38f23c98546b3ecdce6e7b3a7a64ed91e3 100644 (file)
@@ -489,6 +489,7 @@ void AliMUONEventReconstructor::AddHitsForRecFromGEANT(TTree *TH)
     cout << "enter AddHitsForRecFromGEANT with TH: " << TH << endl;
   if (TH == NULL) return;
   AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
     cout << "enter AddHitsForRecFromGEANT with TH: " << TH << endl;
   if (TH == NULL) return;
   AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
+  AliMUONData * muondata = pMUON->GetMUONData();
   // Security on MUON ????
   // See whether it could be the same for signal and background ????
   // Loop over tracks in tree
   // Security on MUON ????
   // See whether it could be the same for signal and background ????
   // Loop over tracks in tree
@@ -497,23 +498,24 @@ void AliMUONEventReconstructor::AddHitsForRecFromGEANT(TTree *TH)
     cout << "ntracks: " << ntracks << endl;
   fMuons = 0; //AZ
   for (Int_t track = 0; track < ntracks; track++) {
     cout << "ntracks: " << ntracks << endl;
   fMuons = 0; //AZ
   for (Int_t track = 0; track < ntracks; track++) {
-    gAlice->ResetHits();
+    muondata->ResetHits();
     TH->GetEvent(track);
     // Loop over hits
     Int_t hit = 0;
     hitBits = 0; // AZ
     chamBits = 0; // AZ
     Int_t itrack = track; //AZ
     TH->GetEvent(track);
     // Loop over hits
     Int_t hit = 0;
     hitBits = 0; // AZ
     chamBits = 0; // AZ
     Int_t itrack = track; //AZ
-    for (AliMUONHit* mHit = (AliMUONHit*) pMUON->FirstHit(-1); 
-        mHit;
-        mHit = (AliMUONHit*) pMUON->NextHit(), hit++) {
-      Int_t ipart = TMath::Abs ((Int_t) mHit->Particle()); //AZ
-      //itrack = mHit->Track(); //AZ
-      //AZNewHitForRecFromGEANT(mHit,track, hit, 1);
-      if (NewHitForRecFromGEANT(mHit,track, hit, 1) && ipart == 13
-      //if (NewHitForRecFromGEANT(mHit,itrack-1, hit, 1) && ipart == 13 
-          && itrack <= 2) chamBits |= BIT(mHit->Chamber()-1); //AZ - set bit
-    } // end of hit loop
+
+    Int_t ihit, nhits=0;
+      nhits = (Int_t) muondata->Hits()->GetEntriesFast();
+      AliMUONHit* mHit=0x0;
+      for(ihit=0; ihit<nhits; ihit++) {
+       mHit = static_cast<AliMUONHit*>(muondata->Hits()->At(ihit));
+       Int_t ipart = TMath::Abs ((Int_t) mHit->Particle()); //AZ
+       if (NewHitForRecFromGEANT(mHit,track, hit, 1) && ipart == 13
+           //if (NewHitForRecFromGEANT(mHit,itrack-1, hit, 1) && ipart == 13 
+           && itrack <= 2) chamBits |= BIT(mHit->Chamber()-1); //AZ - set bit
+      }
     if (chamBits&3 && chamBits>>2&3 && chamBits>>4&3 && chamBits>>6&3 && 
         chamBits>>8&3 && ((chamBits>>6&3)==3 || (chamBits>>8&3)==3)) 
       fMuons += 1; //AZ
     if (chamBits&3 && chamBits>>2&3 && chamBits>>4&3 && chamBits>>6&3 && 
         chamBits>>8&3 && ((chamBits>>6&3)==3 || (chamBits>>8&3)==3)) 
       fMuons += 1; //AZ
index cf7fdbba40ebebb337da1f8f7d6208859b75f004..e56bac990234098e90189db0c19943cd2e0e76d4 100644 (file)
@@ -218,13 +218,15 @@ void MUONrecoNtuple (Int_t FirstEvent = 0, Int_t LastEvent = 0, Int_t RecGeantHi
   AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
   MUONLoader->LoadHits("READ");
   MUONLoader->LoadRecPoints("READ");
   AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
   MUONLoader->LoadHits("READ");
   MUONLoader->LoadRecPoints("READ");
+  AliMUONData  * muondata = MUON->GetMUONData();
 
   Int_t ievent, nevents;
   nevents = RunLoader->GetNumberOfEvents();
 
   // Initializations
 
   Int_t ievent, nevents;
   nevents = RunLoader->GetNumberOfEvents();
 
   // Initializations
-  // AliMUON *MUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
-  MUON->SetTreeAddress(); 
+  //AliMUON *MUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
+  
+  //MUON->SetTreeAddress(); 
   AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor();
 
   Reco->SetRecGeantHits(RecGeantHits);
   AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor();
 
   Reco->SetRecGeantHits(RecGeantHits);
@@ -244,6 +246,7 @@ void MUONrecoNtuple (Int_t FirstEvent = 0, Int_t LastEvent = 0, Int_t RecGeantHi
   for (Int_t event = FirstEvent; event < LastEvent; event++) {
     cout << "Event: " << event << endl;
     RunLoader->GetEvent(event);   
   for (Int_t event = FirstEvent; event < LastEvent; event++) {
     cout << "Event: " << event << endl;
     RunLoader->GetEvent(event);   
+    muondata->SetTreeAddress("H,RC");
     //     Int_t nparticles = gAlice->GetEvent(event);
     //      cout << "nparticles: " << nparticles << endl;
     // prepare background file and/or event if necessary
     //     Int_t nparticles = gAlice->GetEvent(event);
     //      cout << "nparticles: " << nparticles << endl;
     // prepare background file and/or event if necessary