X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=MUON%2FMUONrawclusters.C;h=cdc45b9a01cdca2586e77e1a5ba39745647c26f9;hp=fa8544934245143cfd517067a63f28ffb9ee953f;hb=fb76e30652853a813aa3c0be04276516ba265336;hpb=a897a37a5855b839f1f4ff403bebaa1d4641bbcd diff --git a/MUON/MUONrawclusters.C b/MUON/MUONrawclusters.C index fa854493424..cdc45b9a01c 100644 --- a/MUON/MUONrawclusters.C +++ b/MUON/MUONrawclusters.C @@ -1,140 +1,93 @@ #include "iostream.h" -void MUONrawclusters (Int_t evNumber1=0,Int_t evNumber2=0) -{ -///////////////////////////////////////////////////////////////////////// -// This macro is a small example of a ROOT macro -// illustrating how to read the output of GALICE -// and do some analysis. -// -///////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include -// Dynamically link some shared libs +#include "AliHeader.h" +#include "AliRun.h" - if (gClassTable->GetID("AliRun") < 0) { - gROOT->LoadMacro("loadlibs.C"); - loadlibs(); - } +#include "AliMUON.h" -// Connect the Root Galice file containing Geometry, Kine and Hits +#include "AliMUONClusterFinderVS.h" - TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); - if (!file) file = new TFile("galice.root","UPDATE"); +void MUONrawclusters (char* filename, Int_t evNumber1=0,Int_t evNumber2=0) +{ + ////////////////////////////////////// + // // + // ROOT macro for ALICE Dimuon Arm: // + // Clusterization of digits // + // // + ////////////////////////////////////// + // + // Adds the tree TR for raw clusters + // to the ROOT file "galice.root" + // containing the digits (tree TD). + // + // Arguments: + // evNumber1 = first event number to act on in file "galice.root" + // evNumber2 = last event number to act on in file "galice.root" + // + // Input/output file: + // "galice.root" + // + //__________________________________________________________________________ -// Get AliRun object from file or create it if not on file +// // Dynamically link some shared libs - if (!gAlice) { - gAlice = (AliRun*)file->Get("gAlice"); - if (gAlice) printf("AliRun object found on file\n"); - if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); - } -// -// Set reconstruction models -// -// Get pointers to Alice detectors and Digits containers - AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON"); + //if (gClassTable->GetID("AliRun") < 0) { + // gROOT->LoadMacro("$ALICE_ROOT/macros/loadlibs.C"); + // loadlibs(); + // } - RecModel1 = new AliMUONClusterFinder(); - RecModel1->SetNperMax(90); - //RecModel1->SetClusterSize(12); - RecModel1->SetClusterSize(100); - RecModel1->SetDeclusterFlag(0); - MUON->SetReconstructionModel(0,RecModel1); - - RecModel2 = new AliMUONClusterFinder(); - RecModel2->SetNperMax(90); - //RecModel2->SetClusterSize(12); - RecModel2->SetClusterSize(100); - RecModel2->SetDeclusterFlag(0); - MUON->SetReconstructionModel(1,RecModel2); - - RecModel3 = new AliMUONClusterFinder(); - RecModel3->SetNperMax(90); - //RecModel3->SetClusterSize(12); - RecModel3->SetClusterSize(100); - RecModel3->SetDeclusterFlag(0); - MUON->SetReconstructionModel(2,RecModel3); - - RecModel4 = new AliMUONClusterFinder(); - RecModel4->SetNperMax(90); - //RecModel4->SetClusterSize(12); - RecModel4->SetClusterSize(100); - RecModel4->SetDeclusterFlag(0); - MUON->SetReconstructionModel(3,RecModel4); - - //RecModel5 = new AliMUONClusterFinderv0(); - RecModel5 = new AliMUONClusterFinder(); - RecModel5->SetNperMax(90); - //RecModel5->SetClusterSize(15); - RecModel5->SetClusterSize(100); - RecModel5->SetDeclusterFlag(0); - MUON->SetReconstructionModel(4,RecModel5); - - //RecModel6 = new AliMUONClusterFinderv0(); - RecModel6 = new AliMUONClusterFinder(); - RecModel6->SetNperMax(90); - //RecModel6->SetClusterSize(15); - RecModel6->SetClusterSize(100); - RecModel6->SetDeclusterFlag(0); - MUON->SetReconstructionModel(5,RecModel6); - - RecModel7 = new AliMUONClusterFinder(); - RecModel7->SetNperMax(90); - //RecModel7->SetClusterSize(9); - RecModel7->SetClusterSize(100); - RecModel7->SetDeclusterFlag(0); - MUON->SetReconstructionModel(6,RecModel7); - - RecModel8 = new AliMUONClusterFinder(); - RecModel8->SetNperMax(90); - //RecModel8->SetClusterSize(9); - RecModel8->SetClusterSize(100); - RecModel8->SetDeclusterFlag(0); - MUON->SetReconstructionModel(7,RecModel8); + // Creating Run Loader and openning file containing Hits + AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONFolder","UPDATE"); + if (RunLoader ==0x0) { + printf(">>> Error : Error Opening %s file \n",filename); + return; + } - RecModel9 = new AliMUONClusterFinder(); - RecModel9->SetNperMax(90); - //RecModel9->SetClusterSize(9); - RecModel9->SetClusterSize(100); - RecModel9->SetDeclusterFlag(0); - MUON->SetReconstructionModel(8,RecModel9); + // Loading AliRun master + RunLoader->UnloadgAlice(); + RunLoader->LoadgAlice(); + gAlice = RunLoader->GetAliRun(); - RecModel10 = new AliMUONClusterFinder(); - RecModel10->SetNperMax(90); - // RecModel1->SetClusterSize(9); - RecModel1->SetClusterSize(100); - RecModel10->SetDeclusterFlag(0); - MUON->SetReconstructionModel(9,RecModel10); + // Loading MUON subsystem + AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON"); + AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader"); - + Int_t ievent, nevents; + nevents = RunLoader->GetNumberOfEvents(); + + for (Int_t i=0; i<10; i++) { + //RecModel = new AliMUONClusterFinderVS(); + AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS(); + // RecModel->SetTracks(16,17); + // RecModel->SetTracks(266,267); + RecModel->SetGhostChi2Cut(10); + MUON->SetReconstructionModel(i,RecModel); + } // // Loop over events -// + // Int_t Nh=0; Int_t Nh1=0; - for (int nev=0; nev<= evNumber2; nev++) { - Int_t nparticles = gAlice->GetEvent(nev); - cout << "nev " << nev <TreeH(); - Int_t ntracks = TH->GetEntries(); - cout<<"ntracks "<RunReco("MUON", evNumber1, evNumber2); + for(Int_t ievent=evNumber1; ieventGetEvent(ievent); + MUONLoader->LoadDigits("read"); + if (MUONLoader->TreeR() == 0x0) MUONLoader->MakeTree("R"); + MUON->MakeBranch("R"); + MUON->SetTreeAddress(); + MUON->Digits2Reco(); + MUONLoader->UnloadDigits(); + MUONLoader->UnloadRecPoints(); + } - TClonesArray *Particles = gAlice->Particles(); - TTree *TD = gAlice->TreeD(); - Int_t nent=TD->GetEntries(); - //printf("Found %d entries in the tree (must be one per cathode per event!)\n",nent); - if (MUON) { - MUON->FindClusters(nev,nent-2); - } // end if MUON - } // event loop - //file->ls(); - file->Close(); } +