]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Clean-up of coding rule violations.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Dec 2000 22:14:38 +0000 (22:14 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Dec 2000 22:14:38 +0000 (22:14 +0000)
MUON/AliMUONClusterFinderVS.cxx
MUON/AliMUONClusterInput.cxx
MUON/AliMUONPadHit.cxx
MUON/AliMUONRecoDisplay.cxx
MUON/AliMUONTrackReconstructor.cxx

index 585911934749f4b61b155b2d6418c7d675416f9f..fd8df7c46082003f787d6b4db9b8675e58cb22d7 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
+Revision 1.14  2000/10/23 16:03:45  morsch
+Correct z-position of all clusters created "on the flight".
+
 Revision 1.13  2000/10/23 13:38:23  morsch
 Set correct z-coordinate when cluster is split.
 
@@ -1894,7 +1897,7 @@ void fcnCombiS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t if
     f=chisq;
 }
 
-void AliMUONClusterFinderVS::AddRawCluster(const AliMUONRawCluster c)
+void AliMUONClusterFinderVS::AddRawCluster(const AliMUONRawCluster &c)
 {
   //
   // Add a raw cluster copy to the list
@@ -1906,6 +1909,7 @@ void AliMUONClusterFinderVS::AddRawCluster(const AliMUONRawCluster c)
 }
 
 Bool_t AliMUONClusterFinderVS::TestTrack(Int_t t) {
+// Test if track was user selected
     if (fTrack[0]==-1 || fTrack[1]==-1) {
        return kTRUE;
     } else if (t==fTrack[0] || t==fTrack[1]) {
index 1023f0ee5de73644942381b014fc2d55f7e8e14f..40668c7be9541b4bcf7a835487c9f5914fca27c6 100644 (file)
 
 /*
 $Log$
+Revision 1.6  2000/10/06 09:04:50  morsch
+
+- Dummy z-arguments in GetPadI, SetHit, FirstPad replaced by real z-coordinate
+        to make code work with slat chambers.
+
 Revision 1.5  2000/10/02 16:58:29  egangler
 Cleaning of the code :
 -> coding conventions
@@ -228,5 +233,11 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cat
    return value;
 }
 
+AliMUONClusterInput& AliMUONClusterInput
+::operator = (const AliMUONClusterInput& rhs)
+{
+// Dummy assignment operator
+    return *this;
+}
 
 
index b8975bb3b26a2152362b6e0c2d6808cb6df98fea..676a3f7c389b7b80c18df97e3cf35360ed4e5c81 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.2  2000/06/15 07:58:48  morsch
+Code from MUON-dev joined
+
 Revision 1.1.2.1  2000/06/09 22:02:45  morsch
 Was before in DataStructures.cxx
 
@@ -27,6 +30,7 @@ ClassImp(AliMUONPadHit)
 //___________________________________________
 AliMUONPadHit::AliMUONPadHit(Int_t *clhits)
 {
+// Constructor
    fHitNumber=clhits[0];
    fCathode=clhits[1];
    fQ=clhits[2];
index 9cd230c51cdf5db1338a65caed1e93be598e13a8..6d13a8fa4eca2276afc0e6eaf7004d9fe508d177 100644 (file)
 
 /*
 $Log$
+Revision 1.3  2000/12/21 17:51:54  morsch
+RN3 violations corrected
+
 Revision 1.2  2000/11/23 10:09:39  gosset
 Bug correction in AliMUONRecoDisplay.
-Copyright, $Log$, $Id$, comments at the right place for automatic documentation,
+Copyright, $Log$
+Copyright, Revision 1.3  2000/12/21 17:51:54  morsch
+Copyright, RN3 violations corrected
+Copyright,, $Id$, comments at the right place for automatic documentation,
 in AliMUONRecoEvent and AliMUONRecoDisplay
 
 */
@@ -125,6 +131,7 @@ AliMUONRecoDisplay::~AliMUONRecoDisplay()
 //-------------------------------------------------------------------
 Bool_t AliMUONRecoDisplay::Event(Int_t nevent)
 {
+// Go to event nevent
    fEvent = nevent;
    for (Int_t entry=0; entry<fTree->GetEntries(); entry++) {
       fTree->GetEntry(entry);
@@ -165,10 +172,10 @@ void AliMUONRecoDisplay::MapEvent(Int_t nevent)
    if (fEvGen) fEvGen->Clear();
    fEvGen->SetNoEvent(nevent);
    // get list of particles
-   TClonesArray *Particles = gAlice->Particles();
+   TClonesArray *particles = gAlice->Particles();
    // connect MUON module
-   AliDetector *MUON = gAlice->GetDetector("MUON");
-   if (!MUON) {
+   AliDetector *pMUON = gAlice->GetDetector("MUON");
+   if (!pMUON) {
       cout << "MUON module not present.\n";
       gApplication->Terminate(0);
    }
@@ -181,18 +188,18 @@ void AliMUONRecoDisplay::MapEvent(Int_t nevent)
    Int_t ch;
    // loop all tracks
    for (Int_t track=0; track<ntracks; track++) {
-      hit = (AliMUONHit *) MUON->FirstHit(track);
+      hit = (AliMUONHit *) pMUON->FirstHit(track);
       if (!hit) continue;
-      particle = (TParticle *) Particles->UncheckedAt(hit->Track());
+      particle = (TParticle *) particles->UncheckedAt(hit->Track());
       if (IsReconstructible(track) && TMath::Abs(particle->GetPdgCode())==13) {
          gtrack = fEvGen->AddEmptyTrack();
         gtrack->SetSign(TMath::Sign((Int_t)1, -particle->GetPdgCode()));
         // reset hits
         for (ch=0; ch<10; ch++) gtrack->SetHitPosition(ch,0,0,0);
         // loop all hits
-        for (AliMUONHit *muonHit=(AliMUONHit*)MUON->FirstHit(track);
+        for (AliMUONHit *muonHit=(AliMUONHit*)pMUON->FirstHit(track);
              muonHit;
-             muonHit=(AliMUONHit*)MUON->NextHit()) {
+             muonHit=(AliMUONHit*)pMUON->NextHit()) {
            ch = muonHit->fChamber - 1;
            if (ch<0 || ch>9) continue;
            gtrack->SetHitPosition(ch, muonHit->X(),  muonHit->Y(),  muonHit->Z());
@@ -425,14 +432,14 @@ Bool_t AliMUONRecoDisplay::IsReconstructible(Int_t track)
 // true if at least three hits in first 2 stations, 3 in last 2 stations
 // and one in station 3
    if (fEmpty) return kFALSE;
-   AliDetector *MUON = gAlice->GetDetector("MUON");
+   AliDetector *pMUON = gAlice->GetDetector("MUON");
    Bool_t chHit[10];
    Int_t ch;
    for (ch=0; ch<10; ch++) chHit[ch] = kFALSE;
    //loop hits
-   for (AliMUONHit *muonHit=(AliMUONHit*)MUON->FirstHit(track);
+   for (AliMUONHit *muonHit=(AliMUONHit*)pMUON->FirstHit(track);
         muonHit;
-       muonHit=(AliMUONHit*)MUON->NextHit()) {
+       muonHit=(AliMUONHit*)pMUON->NextHit()) {
       ch = muonHit->fChamber - 1;
       if (ch<0 || ch>9) continue;
       chHit[ch] = kTRUE;
index b90a8486f2d8c229df16da275353c64d9bfda6b8..adfe7c36e7158f66646b2ef1a40b7fdad495294d 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
+Revision 1.3  2000/10/02 21:28:09  fca
+Removal of useless dependecies via forward declarations
+
 Revision 1.2  2000/06/15 07:58:49  morsch
 Code from MUON-dev joined
 
@@ -137,12 +140,12 @@ Float_t type_of_call rndm() {return gRandom->Rndm();}
 void type_of_call fit_trace(Float_t &, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &, Int_t &, Int_t &, Int_t &, Int_t &);
 }
 
-static TTree *pNtupleGlobal;
-static TFile *pHfileGlobal;
-static TTree *treeK1;
-static TTree *TrH1;
-static TClonesArray *fHits2;        //List of hits for one track only
-static TClonesArray *fParticles2;   //List of particles in the Kine tree
+static TTree *gAliNtupleGlobal;
+static TFile *gAliFileGlobal;
+static TTree *gAliTreeK1;
+static TTree *gAliTrH1;
+static TClonesArray *gAliHits2;        //List of hits for one track only
+static TClonesArray *gAliParticles2;   //List of particles in the Kine tree
 
 
 // variables of the tracking ntuple 
@@ -166,6 +169,8 @@ ClassImp(AliMUONTrackReconstructor)
 //___________________________________________________
 AliMUONTrackReconstructor::AliMUONTrackReconstructor()
 {
+// Constructor
+//
    fSPxzCut   = 3.0;
    fSSigmaCut = 4.0;
    fSXPrec    = 0.01; 
@@ -175,11 +180,13 @@ AliMUONTrackReconstructor::AliMUONTrackReconstructor()
 //_____________________________________________________________________________
 void AliMUONTrackReconstructor::Reconst2(Int_t &ifit, Int_t &idebug, Int_t &nev)
 {
+//
+//
     reconstmuon2(ifit,idebug,nev);
 }
 
 //_____________________________________________________________________________
-void AliMUONTrackReconstructor::Reconst(Int_t &ifit, Int_t &idebug, Int_t bgd_ev, Int_t &nev, Int_t &idres, Int_t &ireadgeant, Option_t *option,Text_t *filename)
+void AliMUONTrackReconstructor::Reconst(Int_t &ifit, Int_t &idebug, Int_t bgdEvent, Int_t &nev, Int_t &idres, Int_t &ireadgeant, Option_t *option,Text_t *filename)
 {
   //
   // open kine and hits tree of background file for reconstruction of geant hits 
@@ -194,45 +201,45 @@ void AliMUONTrackReconstructor::Reconst(Int_t &ifit, Int_t &idebug, Int_t bgd_ev
       cout<<"filename  "<<fFileName<<endl;
       pFile=new TFile(fFileName);
       cout<<"I have opened "<<fFileName<<" file "<<endl;
-      fHits2     = new TClonesArray("AliMUONHit",1000);
-      fParticles2 = new TClonesArray("TParticle",1000);
+      gAliHits2     = new TClonesArray("AliMUONHit",1000);
+      gAliParticles2 = new TClonesArray("TParticle",1000);
       first=kFALSE;
     }
     pFile->cd();
-    if(fHits2) fHits2->Clear();
-    if(fParticles2) fParticles2->Clear();
-    if(TrH1) delete TrH1;
-    TrH1=0;
-    if(treeK1) delete treeK1;
-    treeK1=0;
+    if(gAliHits2) gAliHits2->Clear();
+    if(gAliParticles2) gAliParticles2->Clear();
+    if(gAliTrH1) delete gAliTrH1;
+    gAliTrH1=0;
+    if(gAliTreeK1) delete gAliTreeK1;
+    gAliTreeK1=0;
     // Get Hits Tree header from file
     char treeName[20];
-    sprintf(treeName,"TreeH%d",bgd_ev);
-    TrH1 = (TTree*)gDirectory->Get(treeName);
-    //     printf("TrH1 %p of treename %s for event %d \n",TrH1,treeName,bgd_ev);
-    if (!TrH1) {
-      printf("ERROR: cannot find Hits Tree for event:%d\n",bgd_ev);
+    sprintf(treeName,"TreeH%d",bgdEvent);
+    gAliTrH1 = (TTree*)gDirectory->Get(treeName);
+    //     printf("gAliTrH1 %p of treename %s for event %d \n",gAliTrH1,treeName,bgdEvent);
+    if (!gAliTrH1) {
+      printf("ERROR: cannot find Hits Tree for event:%d\n",bgdEvent);
     }
     // set branch addresses
     TBranch *branch;
     char branchname[30];
     AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON");  
     sprintf(branchname,"%s",pMUON->GetName());       
-    if (TrH1 && fHits2) {
-      branch = TrH1->GetBranch(branchname);
-      if (branch) branch->SetAddress(&fHits2);
+    if (gAliTrH1 && gAliHits2) {
+      branch = gAliTrH1->GetBranch(branchname);
+      if (branch) branch->SetAddress(&gAliHits2);
     }
-    TrH1->GetEntries();
+    gAliTrH1->GetEntries();
     // get the Kine tree
-    sprintf(treeName,"TreeK%d",bgd_ev);
-    treeK1 = (TTree*)gDirectory->Get(treeName);
-    if (!treeK1) {
-      printf("ERROR: cannot find Kine Tree for event:%d\n",bgd_ev);
+    sprintf(treeName,"TreeK%d",bgdEvent);
+    gAliTreeK1 = (TTree*)gDirectory->Get(treeName);
+    if (!gAliTreeK1) {
+      printf("ERROR: cannot find Kine Tree for event:%d\n",bgdEvent);
     }
     // set branch addresses
-    if (treeK1) 
-      treeK1->SetBranchAddress("Particles", &fParticles2);
-    treeK1->GetEvent(0);
+    if (gAliTreeK1) 
+      gAliTreeK1->SetBranchAddress("Particles", &gAliParticles2);
+    gAliTreeK1->GetEvent(0);
     
     // get back to the first file
     TTree *treeK = gAlice->TreeK();
@@ -262,6 +269,7 @@ void AliMUONTrackReconstructor::Init(Double_t &seff, Double_t &sb0, Double_t &sb
 //__________________________________________
 void AliMUONTrackReconstructor::FinishEvent()
 {
+// Finish
     TTree *treeK = gAlice->TreeK();
     TFile *file1 = 0;
     if (treeK) file1 = treeK->GetCurrentFile();
@@ -316,21 +324,21 @@ void hist_create()
   // Create an output file ("reconst.root")
   // Create some histograms and an ntuple
 
-    pHfileGlobal = new TFile("reconst.root","RECREATE","Ntuple - reconstruction");
-
-   pNtupleGlobal = new TTree("ntuple","Reconst ntuple");
-   pNtupleGlobal->Branch("ievr",&NtupleSt.ievr,"ievr/I");
-   pNtupleGlobal->Branch("ntrackr",&NtupleSt.ntrackr,"ntrackr/I");
-   pNtupleGlobal->Branch("istatr",&NtupleSt.istatr[0],"istatr[500]/I");
-   pNtupleGlobal->Branch("isignr",&NtupleSt.isignr[0],"isignr[500]/I");
-   pNtupleGlobal->Branch("pxr",&NtupleSt.pxr[0],"pxr[500]/F");
-   pNtupleGlobal->Branch("pyr",&NtupleSt.pyr[0],"pyr[500]/F");
-   pNtupleGlobal->Branch("pzr",&NtupleSt.pzr[0],"pzr[500]/F");
-   pNtupleGlobal->Branch("zvr",&NtupleSt.zvr[0],"zvr[500]/F");
-   pNtupleGlobal->Branch("chi2r",&NtupleSt.chi2r[0],"chi2r[500]/F");
-   pNtupleGlobal->Branch("pxv",&NtupleSt.pxv[0],"pxv[500]/F");
-   pNtupleGlobal->Branch("pyv",&NtupleSt.pyv[0],"pyv[500]/F");
-   pNtupleGlobal->Branch("pzv",&NtupleSt.pzv[0],"pzv[500]/F");
+    gAliFileGlobal = new TFile("reconst.root","RECREATE","Ntuple - reconstruction");
+
+   gAliNtupleGlobal = new TTree("ntuple","Reconst ntuple");
+   gAliNtupleGlobal->Branch("ievr",&NtupleSt.ievr,"ievr/I");
+   gAliNtupleGlobal->Branch("ntrackr",&NtupleSt.ntrackr,"ntrackr/I");
+   gAliNtupleGlobal->Branch("istatr",&NtupleSt.istatr[0],"istatr[500]/I");
+   gAliNtupleGlobal->Branch("isignr",&NtupleSt.isignr[0],"isignr[500]/I");
+   gAliNtupleGlobal->Branch("pxr",&NtupleSt.pxr[0],"pxr[500]/F");
+   gAliNtupleGlobal->Branch("pyr",&NtupleSt.pyr[0],"pyr[500]/F");
+   gAliNtupleGlobal->Branch("pzr",&NtupleSt.pzr[0],"pzr[500]/F");
+   gAliNtupleGlobal->Branch("zvr",&NtupleSt.zvr[0],"zvr[500]/F");
+   gAliNtupleGlobal->Branch("chi2r",&NtupleSt.chi2r[0],"chi2r[500]/F");
+   gAliNtupleGlobal->Branch("pxv",&NtupleSt.pxv[0],"pxv[500]/F");
+   gAliNtupleGlobal->Branch("pyv",&NtupleSt.pyv[0],"pyv[500]/F");
+   gAliNtupleGlobal->Branch("pzv",&NtupleSt.pzv[0],"pzv[500]/F");
 
    // test aliroot
 
@@ -698,7 +706,7 @@ void chfnt(Int_t &ievr, Int_t &ntrackr, Int_t *istatr, Int_t *isignr, Float_t *p
        NtupleSt.pyv[i]    = pyv[i];
        NtupleSt.pzv[i]    = pzv[i];
     }
-    pNtupleGlobal->Fill();   
+    gAliNtupleGlobal->Fill();   
 }
 
 //________________
@@ -706,7 +714,7 @@ void hist_closed()
 {
   //
   // write histos and ntuple to "reconst.root" file
-  pHfileGlobal->Write();
+  gAliFileGlobal->Write();
 }
 
 //________________________________________________________________________
@@ -753,7 +761,7 @@ void trackf_read_fit(Int_t &ievr, Int_t &nev, Int_t &nhittot1, Int_t *izch, Doub
   } // track loop
 
   ievr=nev;
-  pHfileGlobal->cd();    
+  gAliFileGlobal->cd();    
 }
 
 //______________________________________________________________________________
@@ -873,21 +881,21 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p
 //      } // if pMUON
   } // track loop first file
 
-  if (TrH1 && fHits2 ) { // if background file
-    ntracks =(Int_t)TrH1->GetEntries();
+  if (gAliTrH1 && gAliHits2 ) { // if background file
+    ntracks =(Int_t)gAliTrH1->GetEntries();
     printf("Trackf_read - 2-nd file - ntracks %d\n",ntracks);
 
     //  Loop over tracks
     for (Int_t track=0; track<ntracks; track++) {
       
-      if (fHits2) fHits2->Clear();
-      TrH1->GetEvent(track);
+      if (gAliHits2) gAliHits2->Clear();
+      gAliTrH1->GetEvent(track);
 
       //  Loop over hits
       AliMUONHit *mHit;
-      for (int i=0;i<fHits2->GetEntriesFast();i++) 
+      for (int i=0;i<gAliHits2->GetEntriesFast();i++) 
        {
-         mHit=(AliMUONHit*) (*fHits2)[i];
+         mHit=(AliMUONHit*) (*gAliHits2)[i];
          if (mHit->fChamber > 10) continue;
          if (maxidg<=20000) {
            
@@ -908,7 +916,7 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p
            Int_t id1  = ftrack;                   // track number 
            Int_t idum = track+1;
            
-           TClonesArray *fPartArray = fParticles2;
+           TClonesArray *fPartArray = gAliParticles2;
 //         TParticle *Part=NULL;
            Int_t id = ((TParticle*) fPartArray->UncheckedAt(ftrack))->GetPdgCode();
            if (id==kMuonPlus||id==kMuonMinus) {
@@ -929,7 +937,7 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p
          } // check limits (maxidg)
        } // hit loop 
     } // track loop
-  } // if TrH1
+  } // if gAliTrH1
 
   ievr = nev;
   nhittot1 = maxidg ;
@@ -939,7 +947,7 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p
   if (nres>=19) nbres++;
   printf("nres, nbres %d %d \n",nres,nbres);
 
-  pHfileGlobal->cd();      
+  gAliFileGlobal->cd();      
 
 }
 
@@ -1031,7 +1039,7 @@ void trackf_read_spoint(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *
        
        treeR->Reset();
 
-       pHfileGlobal->cd();
+       gAliFileGlobal->cd();
 
     } // if pMUON
 }