ELIBS:= MUONgeometry MUONrec MUONsim MUONbase MUONmapping \
TPCbase TPCsim TPCrec TPCfast \
- ITS PMDbase PMDsim PMDrec TRDbase TRDsim TRDrec TRDfast \
+ ITSbase ITSsim ITSrec PMDbase PMDsim PMDrec TRDbase \
+ TRDsim TRDrec TRDfast \
FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOS CRT \
RICHbase RICHrec RICHsim \
ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCAL \
MUON/tgt_$(ALICE_TARGET)/G__MUONsim.o $(LIBPATH)/libMUONsim.a \
MUON/tgt_$(ALICE_TARGET)/G__MUONrec.o $(LIBPATH)/libMUONrec.a \
PHOS/tgt_$(ALICE_TARGET)/G__PHOS.o $(LIBPATH)/libPHOS.a \
- ITS/tgt_$(ALICE_TARGET)/G__ITS.o $(LIBPATH)/libITS.a \
+ ITS/tgt_$(ALICE_TARGET)/G__ITSbase.o $(LIBPATH)/libITSbase.a \
+ ITS/tgt_$(ALICE_TARGET)/G__ITSsim.o $(LIBPATH)/libITSsim.a \
+ ITS/tgt_$(ALICE_TARGET)/G__ITSrec.o $(LIBPATH)/libITSrec.a \
STRUCT/tgt_$(ALICE_TARGET)/G__STRUCT.o $(LIBPATH)/libSTRUCT.a \
TPC/tgt_$(ALICE_TARGET)/G__TPCbase.o $(LIBPATH)/libTPCbase.a \
TPC/tgt_$(ALICE_TARGET)/G__TPCsim.o $(LIBPATH)/libTPCsim.a \
#include "AliClusters.h"
#include "AliDisplay2.h"
#include "AliDisplayClusters.h"
-#include "AliITS.h"
#include "AliITSLoader.h"
#include "AliITSclusterV2.h"
#include "AliITSgeom.h"
return;
}
AliITSLoader *itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
- AliITS *its = (AliITS*)gAlice->GetModule("ITS");
rl->GetEvent(nevent);
itsl->LoadRecPoints();
return;
}
- AliITSgeom *geom=its->GetITSgeom();
+ TDirectory * olddir = gDirectory;
+ rl->CdGAFile();
+ AliITSgeom *geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+ olddir->cd();
Int_t count = 0;
TClonesArray *clusters=new TClonesArray("AliITSclusterV2",10000);
SetSecondLayerModules();
fZFound = 0;
fZsig = 0.;
- fITS = 0;
+ //fITS = 0;
fZCombc = 0;
fZCombf = 0;
SetLowLimit();
itsLoader->LoadRecPoints();
rl->GetEvent(evnumber);
- if(!fITS) {
+ /* if(!fITS) {
fITS = (AliITS*)gAlice->GetModule("ITS");
if(!fITS) {
Error("FindVertexForCurrentEvent","AliITS object was not found");
return fCurrentVertex;
}
}
+ */
- fITS->SetTreeAddress();
-
- AliITSgeom *geom = fITS->GetITSgeom();
+ // fITS->SetTreeAddress();
+ rl->CdGAFile();
+ // AliITSgeom *geom = fITS->GetITSgeom();
+ AliITSgeom *geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
TTree *tR = itsLoader->TreeR();
-
+
return FindVertexForCurrentEvent(geom,tR);
}
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//-------------------------------------------------------------------------
-// Implementation of the cascade vertex class
-//
-// Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr
-//-------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////
+// Implementation of the cascade vertex class //
+// //
+// Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr//
+////////////////////////////////////////////////////////////////////////////
#include <TMath.h>
#include "AliCascadeVertex.h"
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-//-------------------------------------------------------------------------
-// Cascade Vertex Class
-//
-// Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr
-//-------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////
+// Cascade Vertex Class //
+// //
+// Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr //
+////////////////////////////////////////////////////////////////////////////
#include "AliESDcascade.h"
//
///////////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
#include <stdlib.h>
-
-#include <TBranch.h>
#include <TClonesArray.h>
#include <TFile.h>
-#include <TMath.h>
-#include <TObjectTable.h>
-#include <TROOT.h>
-#include <TRandom.h>
+#include <TParticle.h>
#include <TString.h>
#include <TTree.h>
-#include <TVector.h>
#include <TVirtualMC.h>
-
-#include "AliConfig.h"
-#include "AliHeader.h"
+#include "AliDetector.h"
#include "AliITS.h"
-#include "AliITSClusterFinderSDD.h"
-#include "AliITSClusterFinderSPD.h"
-#include "AliITSClusterFinderSSD.h"
-#include "AliITSClusterFinderV2SDD.h"
-#include "AliITSClusterFinderV2SPD.h"
-#include "AliITSClusterFinderV2SSD.h"
+#include "AliITSDetTypeSim.h"
#include "AliITSDDLRawData.h"
-#include "AliITSDetType.h"
-#include "AliITSDigitizer.h"
#include "AliITSLoader.h"
-#include "AliITSRawClusterSDD.h"
-#include "AliITSRawClusterSPD.h"
-#include "AliITSRawClusterSSD.h"
-#include "AliITSRecPoint.h"
-#include "AliITSclusterV2.h"
-#include "AliITSdigitSDD.h"
-#include "AliITSdigitSPD.h"
-#include "AliITSdigitSSD.h"
-#include "AliITSgeom.h"
#include "AliITShit.h"
#include "AliITSmodule.h"
-#include "AliITSpList.h"
-#include "AliITSresponseSDD.h"
-#include "AliITSresponseSPD.h"
-#include "AliITSresponseSSD.h"
-#include "AliITSsegmentationSDD.h"
-#include "AliITSsegmentationSPD.h"
-#include "AliITSsegmentationSSD.h"
-#include "AliITSsimulationSDD.h"
-#include "AliITSsimulationSPD.h"
-#include "AliITSsimulationSSD.h"
-#include "AliLog.h"
+#include "AliITSpListItem.h"
+#include "AliITSsimulation.h"
+#include "AliITSsimulationFastPoints.h"
#include "AliMC.h"
-#include "AliRawReader.h"
+#include "AliITSDigitizer.h"
+#include "AliITSRecPoint.h"
+#include "AliITSclusterV2.h"
#include "AliRun.h"
+#include "AliLog.h"
ClassImp(AliITS)
//______________________________________________________________________
-AliITS::AliITS() : AliDetector(),
- fITSgeom(0),
- fEuclidOut(0),
- fITSmodules(0),
- fOpt("All"),
- fIdN(0),
- fIdSens(0),
- fIdName(0),
- fNDetTypes(kNTYPES),
- fDetTypes(0),
- fSDigits(0),
- fNSDigits(0),
- fDtype(0),
- fNdtype(0),
- fCtype(0),
- fNctype(0),
- fRecPoints(0),
- fNRecPoints(0),
- fClustersV2(0),
- fNClustersV2(0),
- fSelectedVertexer(0){
- // Default initializer for ITS
- // The default constructor of the AliITS class. In addition to
- // creating the AliITS class it zeros the variables fIshunt (a member
- // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
- // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
- // is also called.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return:
- // Blank ITS class.
-
- fIshunt = 0; // not zeroed in AliDetector.
-
- // AliITS variables.
+AliITS::AliITS() : AliDetector(){
+ // Default initializer for ITS
+ // The default constructor of the AliITS class. In addition to
+ // creating the AliITS class it zeros the variables fIshunt (a member
+ // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
+ // fIdSens, and fIdName. The AliDetector default constructor
+ // is also called.
+
+ fEuclidOut=0;
+ fOpt="All";
+ fIdSens=0;
+ fIdName=0;
+ fDetTypeSim=0;
+ fIshunt = 0; // not zeroed in AliDetector.
+ fHits =0;
+ fNhits=0;
+ fITSmodules=0;
+
// SetDetectors(); // default to fOpt="All". This variable not written out.
SetMarkerColor(kRed);
- SelectVertexer(" ");
}
//______________________________________________________________________
-AliITS::AliITS(const char *name, const char *title):AliDetector(name,title),
- fITSgeom(0),
- fEuclidOut(0),
- fITSmodules(0),
- fOpt("All"),
- fIdN(0),
- fIdSens(0),
- fIdName(0),
- fNDetTypes(kNTYPES),
- fDetTypes(0),
- fSDigits(0),
- fNSDigits(0),
- fDtype(0),
- fNdtype(0),
- fCtype(0),
- fNctype(0),
- fRecPoints(0),
- fNRecPoints(0),
- fClustersV2(0),
- fNClustersV2(0),
- fSelectedVertexer(0){
- // The standard Constructor for the ITS class. In addition to
- // creating the AliITS class, it allocates memory for the TClonesArrays
- // fHits, fSDigits, fDigits, fITSpoints, and the TObjArray of fCtype
- // (clusters). It also zeros the variables
- // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
- // the pointers fIdSens and fIdName. To help in displaying hits via the
- // ROOT macro display.C AliITS also sets the marker color to red. The
- // variables passes with this constructor, const char *name and *title,
- // are used by the constructor of AliDetector class. See AliDetector
- // class for a description of these parameters and its constructor
- // functions.
- // Inputs:
- // const char *name Detector name. Should always be "ITS"
- // const char *title Detector title.
- // Outputs:
- // none.
- // Return:
- // An ITS class.
-
- fIshunt = 0; // not zeroed in AliDetector
- fHits = new TClonesArray("AliITShit", 1560);//not done in AliDetector
- // Not done in AliDetector.
- if(gAlice->GetMCApp()) gAlice->GetMCApp()->AddHitList(fHits);
-
- fEuclidOut = 0;
- fITSgeom = 0;
- fITSmodules = 0;
- SetDetectors(); // default to fOpt="All". This variable not written out.
-
- fIdN = 0;
- fIdName = 0;
- fIdSens = 0;
-
- fNDetTypes = kNTYPES;
- fDetTypes = new TObjArray(fNDetTypes);
-
- fSDigits = new TClonesArray("AliITSpListItem",1000);
- fNSDigits = 0;
-
- fNdtype = new Int_t[fNDetTypes];
- fDtype = new TObjArray(fNDetTypes);
-
- fCtype = new TObjArray(fNDetTypes);
- fNctype = new Int_t[fNDetTypes];
-
- fRecPoints = new TClonesArray("AliITSRecPoint",1000);
- fNRecPoints = 0;
- fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- fNClustersV2=0;
-
- Int_t i;
- for(i=0;i<fNDetTypes;i++) {
- fDetTypes->AddAt(new AliITSDetType(),i);
- fNdtype[i] = 0;
- fNctype[i] = 0;
- } // end for i
+AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
+ // The standard Constructor for the ITS class.
+ // It also zeros the variables
+ // fIshunt (a member of AliDetector class), fEuclidOut, and zeros
+ // the pointers fIdSens and fIdName. To help in displaying hits via the
+ // ROOT macro display.C AliITS also sets the marker color to red. The
+ // variables passes with this constructor, const char *name and *title,
+ // are used by the constructor of AliDetector class. See AliDetector
+ // class for a description of these parameters and its constructor
+ // functions.
+
+ fEuclidOut=0;
+ fOpt="All";
+ fIdSens=0;
+ fIdName=0;
+ fDetTypeSim=0;
+ fHits = new TClonesArray("AliITShit",1560);
+ if(gAlice->GetMCApp()) gAlice->GetMCApp()->AddHitList(fHits);
+ fNhits=0;
+ fITSmodules = 0;
+
+ fIshunt = 0; // not zeroed in AliDetector
+ // Not done in AliDetector.
+
+ fEuclidOut = 0;
+ SetDetectors(); // default to fOpt="All". This variable not written out.
+
+ fIdName = 0;
+ fIdSens = 0;
+
+ fDetTypeSim = new AliITSDetTypeSim();
+
+ SetMarkerColor(kRed);
- SetMarkerColor(kRed);
- SelectVertexer(" ");
}
//______________________________________________________________________
AliITS::~AliITS(){
// Default destructor for ITS.
// The default destructor of the AliITS class. In addition to deleting
- // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
- // fSDigits, fCtype, fITSmodules, fITSgeom, fRecPoints, fIdSens, fIdName,
- // fITSpoints, fDetType and it's contents.
+ // the AliITS class it deletes the memory pointed to by
+ // fIdSens, fIdName, fDetTypeSim and it's contents.
// Inputs:
// none.
// Outputs:
// none.
// Return:
// none.
-
if (fHits) {
fHits->Delete();
delete fHits;
fHits=0;
}
- if (fSDigits) {
- fSDigits->Delete();
- delete fSDigits;
- fSDigits=0;
- }
- if (fDigits) {
- fDigits->Delete();
- delete fDigits;
- fDigits=0;
- }
- if (fRecPoints) {
- fRecPoints->Delete();
- delete fRecPoints;
- fRecPoints=0;
- }
- if(fClustersV2){
- fClustersV2->Delete();
- delete fClustersV2;
- fClustersV2=0;
- }
- delete[] fIdName; // Array of TStrings
- delete[] fIdSens;
if(fITSmodules) {
this->ClearModules();
delete fITSmodules;
fITSmodules = 0;
}// end if fITSmodules!=0
- if(fDtype) {
- fDtype->Delete();
- delete fDtype;
- } // end if fDtype
- delete [] fNdtype;
- if (fCtype) {
- fCtype->Delete();
- delete fCtype;
- fCtype = 0;
- } // end if fCtype
- delete [] fNctype;
-
- if (fDetTypes) {
- fDetTypes->Delete();
- delete fDetTypes;
- fDetTypes = 0;
- } // end if fDetTypes
-
-
- if (fITSgeom) delete fITSgeom;
+ delete[] fIdName; // Array of TStrings
+ delete[] fIdSens;
+
+ if (fDetTypeSim){
+ delete fDetTypeSim;
+ fDetTypeSim = 0;
+ }
}
//______________________________________________________________________
AliITS::AliITS(const AliITS &source) : AliDetector(source){
exit(1);
}
//______________________________________________________________________
-AliITS& AliITS::operator=(AliITS &source){
+AliITS& AliITS::operator=(const AliITS &source){
// Assignment operator. This is a function which is not allowed to be
// done to the ITS. It exits with an error.
// Inputs:
SetDefaults();
// Array of TStrings
if(gMC) for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
+
+ WriteGeometry();
+}
+
+//______________________________________________________________________
+void AliITS::WriteGeometry(){
+
+ //Writes ITS geomtry on gAlice
+
+ if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName());
+ AliRunLoader* rl = fLoader->GetRunLoader();
+ rl->CdGAFile();
+ AliITSgeom* geom = GetITSgeom();
+ geom->Write();
+
}
+
//______________________________________________________________________
void AliITS::SetDefaults(){
// sets the default segmentation, response, digit and raw cluster classes.
// none.
// Return:
// none.
- AliITSsegmentation *seg;
- AliITSresponse *resp;
- AliITSDetType *iDetType;
-
- AliInfoClass("Seting Defaults");
-
- //SPD
- iDetType = DetType(kSPD);
- if(iDetType){
- if (!iDetType->GetSegmentationModel()) {
- seg = new AliITSsegmentationSPD(fITSgeom);
- SetSegmentationModel(kSPD,seg);
- } // end if
- if (!iDetType->GetResponseModel()) {
- SetResponseModel(kSPD,new AliITSresponseSPD());
- } // end if
- // set digit and raw cluster classes to be used
-
- const char *kData0=(iDetType->GetResponseModel())->DataType();
- if (strstr(kData0,"real")) {
- iDetType->ClassNames("AliITSdigit","AliITSRawClusterSPD");
- } else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
- } // end if iDetType
-
- // SDD
- iDetType = DetType(kSDD);
- if(iDetType){
- if (!iDetType->GetResponseModel()) {
- SetResponseModel(kSDD,new AliITSresponseSDD("simulated"));
- } // end if
- resp = iDetType->GetResponseModel();
- if (!iDetType->GetSegmentationModel()) {
- seg = new AliITSsegmentationSDD(fITSgeom,resp);
- SetSegmentationModel(kSDD,seg);
- } // end if
- const char *kData1 = (iDetType->GetResponseModel())->DataType();
- const char *kopt = iDetType->GetResponseModel()->ZeroSuppOption();
- if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D")) ||
- strstr(kData1,"real") ){
- iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
- } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
- } // end if iDetType
-
- // SSD
- iDetType = DetType(kSSD);
- if(iDetType){
- if (!iDetType->GetSegmentationModel()) {
- seg = new AliITSsegmentationSSD(fITSgeom);
- SetSegmentationModel(kSSD,seg);
- } // end if
- if (!iDetType->GetResponseModel()) {
- SetResponseModel(kSSD,new AliITSresponseSSD("simulated"));
- } // end if
- const char *kData2 = (iDetType->GetResponseModel())->DataType();
- if (strstr(kData2,"real")) {
- iDetType->ClassNames("AliITSdigit","AliITSRawClusterSSD");
- } else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
- } // end if iDetType
-
- if (kNTYPES>3) {
- Warning("SetDefaults",
- "Only the three basic detector types are initialized!");
- } // end if
+ AliInfoClass("Setting Defaults");
+
+ if(!fDetTypeSim) {
+ Error("SetDefaults()","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->SetDefaults();
+
+
}
//______________________________________________________________________
void AliITS::SetDefaultSimulation(){
// none.
// Return:
// none.
- AliITSDetType *iDetType;
- AliITSsimulation *sim;
- AliITSsegmentation *seg;
- AliITSresponse *res;
-
- iDetType = DetType(kSPD);
- if(iDetType){
- sim = iDetType->GetSimulationModel();
- if (!sim) {
- seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
- res = (AliITSresponse*)iDetType->GetResponseModel();
- sim = new AliITSsimulationSPD(seg,res);
- SetSimulationModel(kSPD,sim);
- }else{ // simulation exists, make sure it is set up properly.
- if(sim->GetResponseModel()==0) sim->SetResponseModel(
- (AliITSresponse*)iDetType->GetResponseModel());
- if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
- (AliITSsegmentation*)iDetType->GetSegmentationModel());
- sim->Init();
- } // end if
- }// end if iDetType
- iDetType = DetType(kSDD);
- if(iDetType){
- sim = iDetType->GetSimulationModel();
- if (!sim) {
- seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
- res = (AliITSresponse*)iDetType->GetResponseModel();
- sim = new AliITSsimulationSDD(seg,res);
- SetSimulationModel(kSDD,sim);
- }else{ // simulation exists, make sure it is set up properly.
- if(sim->GetResponseModel()==0) sim->SetResponseModel(
- (AliITSresponse*)iDetType->GetResponseModel());
- if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
- (AliITSsegmentation*)iDetType->GetSegmentationModel());
- sim->Init();
- } //end if
- }// end if iDetType
- iDetType = DetType(kSSD);
- if(iDetType){
- sim = iDetType->GetSimulationModel();
- if (!sim) {
- seg =(AliITSsegmentation*)iDetType->GetSegmentationModel();
- res = (AliITSresponse*)iDetType->GetResponseModel();
- sim = new AliITSsimulationSSD(seg,res);
- SetSimulationModel(kSSD,sim);
- }else{ // simulation exists, make sure it is set up properly.
- if(sim->GetResponseModel()==0) sim->SetResponseModel(
- (AliITSresponse*)iDetType->GetResponseModel());
- if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
- (AliITSsegmentation*)iDetType->GetSegmentationModel());
- sim->Init();
- } // end if
- } // end if iDetType
-}
-//______________________________________________________________________
-void AliITS::SetDefaultClusterFinders(){
- // Sets the default cluster finders. Used in finding RecPoints.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return:
- // none.
- AliITSDetType *iDetType;
- AliITSsegmentation *seg;
- AliITSClusterFinder *clf;
- AliITSresponse *res;
-
- MakeTreeC();
-
- // SPD
- iDetType=DetType(kSPD);
- if(iDetType){
- if (!iDetType->GetReconstructionModel()) {
- seg =(AliITSsegmentation*)iDetType->GetSegmentationModel();
- TClonesArray *dig0 = DigitsAddress(0);
- TClonesArray *recp0 = ClustersAddress(0);
- clf = new AliITSClusterFinderSPD(seg,dig0,recp0);
- SetReconstructionModel(kSPD,clf);
- } // end if
- } // end if iDetType
-
- // SDD
- iDetType=DetType(kSDD);
- if(iDetType){
- if (!iDetType->GetReconstructionModel()) {
- seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
- res = (AliITSresponse*)iDetType->GetResponseModel();
- TClonesArray *dig1 = DigitsAddress(1);
- TClonesArray *recp1 = ClustersAddress(1);
- clf = new AliITSClusterFinderSDD(seg,res,dig1,recp1);
- SetReconstructionModel(kSDD,clf);
- } // end if
- } // end if iDetType
-
- // SSD
- iDetType=DetType(kSSD);
- if(iDetType){
- if (!iDetType->GetReconstructionModel()) {
- seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
- TClonesArray *dig2 = DigitsAddress(2);
- clf = new AliITSClusterFinderSSD(seg,dig2);
- SetReconstructionModel(kSSD,clf);
- } // end if
- } // end if iDetType
-}
+ if(!fDetTypeSim) {
+ Error("SetDefaultSimulation()","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->SetDefaultSimulation();
-//______________________________________________________________________
-void AliITS::SetDefaultClusterFindersV2(){
- // Sets the default cluster finders. Used in finding RecPoints.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return:
- // none.
- AliITSDetType *iDetType;
- AliITSsegmentation *seg;
- AliITSClusterFinder *clf;
-
- MakeTreeC();
-
- // SPD
- iDetType=DetType(kSPD);
- if(iDetType){
- if (!iDetType->GetReconstructionModel()) {
- seg =(AliITSsegmentation*)iDetType->GetSegmentationModel();
- clf = new AliITSClusterFinderV2SPD();
- clf->SetSegmentation(seg);
- clf->SetDigits(DigitsAddress(0));
- SetReconstructionModel(kSPD,clf);
- } // end if
- } // end if iDetType
-
- // SDD
- iDetType=DetType(kSDD);
- if(iDetType){
- if (!iDetType->GetReconstructionModel()) {
- seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
- clf = new AliITSClusterFinderV2SDD();
- clf->SetSegmentation(seg);
- clf->SetDigits(DigitsAddress(1));
- SetReconstructionModel(kSDD,clf);
- } // end if
- } // end if iDetType
-
- // SSD
- iDetType=DetType(kSSD);
- if(iDetType){
- if (!iDetType->GetReconstructionModel()) {
- seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
- clf = new AliITSClusterFinderV2SSD();
- clf->SetSegmentation(seg);
- clf->SetDigits(DigitsAddress(2));
- SetReconstructionModel(kSSD,clf);
- } // end if
- } // end if iDetType
}
// none.
// Return:
// none.
- Bool_t cH = (strstr(option,"H")!=0);
- Bool_t cS = (strstr(option,"S")!=0);
- Bool_t cD = (strstr(option,"D")!=0);
- Bool_t cR = (strstr(option,"R")!=0);
- Bool_t cRF = (strstr(option,"RF")!=0);
- Bool_t v2 = (strstr(option,"v2")!=0);
-
+ if(!fDetTypeSim) {
+ Error("MakeBranch","fDetTypeSim is 0!");
+ return;
+ }
- if(cRF)cR = kFALSE;
- if(cH && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
-
- AliDetector::MakeBranch(option);
+ Bool_t cH = (strstr(option,"H")!=0);
+ Bool_t cS = (strstr(option,"S")!=0);
+ Bool_t cD = (strstr(option,"D")!=0);
+
+ if(cH && (fHits == 0x0)) fHits = new TClonesArray("AliITShit", 1560);
+ AliDetector::MakeBranch(option);
+
+ if(cS) MakeBranchS(0);
+ if(cD) MakeBranchD(0);
+
+
+}
+//___________________________________________________________________
+void AliITS::MakeBranchS(const char* fl){
+
+ // Creates Tree Branch for the ITS summable digits.
+ // Inputs:
+ // cont char *fl File name where SDigits branch is to be written
+ // to. If blank it write the SDigits to the same
+ // file in which the Hits were found.
+
+
+ if(!fDetTypeSim){
+ Error("MakeBranchS","fDetTypeSim is 0!");
+ }
+ Int_t buffersize = 4000;
+ char branchname[30];
+
+ // only one branch for SDigits.
+ sprintf(branchname,"%s",GetName());
+
+ if(fLoader->TreeS()){
+ if(fDetTypeSim->GetSDigits()==0x0) fDetTypeSim->SetSDigits(new TClonesArray("AliITSpListItem",1000));
+ TClonesArray* sdig = (TClonesArray*)fDetTypeSim->GetSDigits();
+ MakeBranchInTree(fLoader->TreeS(),branchname,&sdig,buffersize,fl);
+ }
+}
+//______________________________________________________________________
+void AliITS::MakeBranchD(const char* file){
+
+ //Make branch for digits
+ if(!fDetTypeSim) {
+ Warning("MakeBranchD","fDetTypeSim is 0!");
+ return;
+ }
+ fDetTypeSim->SetLoader(fLoader);
+ MakeBranchInTreeD(fLoader->TreeD(),file);
+}
+
+//___________________________________________________________________
+void AliITS:: MakeBranchInTreeD(TTree* treeD, const char* file){
+ // Creates Tree branches for the ITS.
+
+ if(!fDetTypeSim){
+ Error("MakeBranchS","fDetTypeSim is 0!");
+ }
+ fDetTypeSim->SetLoader(fLoader);
+
+ const Char_t *det[3] = {"SPD","SDD","SSD"};
+ Char_t* digclass;
+ Int_t buffersize = 4000;
+ Char_t branchname[30];
+
+ if(!fDetTypeSim->GetDigits()){
+ fDetTypeSim->SetDigits(new TObjArray(fgkNTYPES));
+ }
+ for(Int_t i=0;i<fgkNTYPES;i++){
+ digclass = fDetTypeSim->GetDigitClassName(i);
+ TString classn = digclass;
+ if(!((fDetTypeSim->GetDigits())->At(i))){
+ (fDetTypeSim->GetDigits())->AddAt(new TClonesArray(classn.Data(),1000),i);
+ }
+ else ResetDigits(i);
+ if(fgkNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
+ else sprintf(branchname,"%sDigits%d",GetName(),i+1);
+ TObjArray* dig = DigitsAddress(i);
+ if(GetDigits() && treeD) AliDetector::MakeBranchInTree(treeD,branchname, &dig,buffersize,file);
+ }
- if(cS) MakeBranchS(0);
- if(cD) MakeBranchD(0);
- if(cR) MakeBranchR(0);
- if(cRF) MakeBranchRF(0);
- if(v2) MakeBranchR(0,"v2");
}
//______________________________________________________________________
void AliITS::SetTreeAddress(){
// none.
// Return:
// none.
- TTree *treeS = fLoader->TreeS();
- TTree *treeD = fLoader->TreeD();
- TTree *treeR = fLoader->TreeR();
- if (fLoader->TreeH() && (fHits == 0x0))
- fHits = new TClonesArray("AliITShit", 1560);
- AliDetector::SetTreeAddress();
+ if(!fDetTypeSim) {
+ Error("SetTreeAddress","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->SetLoader(fLoader);
+
+ TTree *treeS = fLoader->TreeS();
+ TTree *treeD = fLoader->TreeD();
+ if (fLoader->TreeH() && (fHits == 0x0)) {
+ fHits = new TClonesArray("AliITShit", 1560);
+ }
+ AliDetector::SetTreeAddress();
+
+ fDetTypeSim->SetTreeAddressS(treeS, (Char_t*)GetName());
+ fDetTypeSim->SetTreeAddressD(treeD, (Char_t*)GetName());
+
- SetTreeAddressS(treeS);
- SetTreeAddressD(treeD);
- SetTreeAddressR(treeR);
}
//______________________________________________________________________
void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
// none.
// Return:
// none.
+ TClonesArray &lhits = *fHits;
+ new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
- TClonesArray &lhits = *fHits;
- new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
}
-//______________________________________________________________________
-void AliITS::InitModules(Int_t size,Int_t &nmodules){
- // Initialize the modules array.
- // Inputs:
- // Int_t size Size of array of the number of modules to be
- // created. If size <=0 then the number of modules
- // is gotten from AliITSgeom class kept in fITSgeom.
- // Outputs:
- // Int_t &nmodules The number of modules existing.
- // Return:
- // none.
-
- if(fITSmodules){
- fITSmodules->Delete();
- delete fITSmodules;
- } // end fir fITSmoudles
-
- Int_t nl,indexMAX,index;
-
- if(size<=0){ // default to using data stored in AliITSgeom
- if(fITSgeom==0) {
- Error("InitModules","fITSgeom not defined");
- return;
- } // end if fITSgeom==0
- nl = fITSgeom->GetNlayers();
- indexMAX = fITSgeom->GetIndexMax();
- nmodules = indexMAX;
- fITSmodules = new TObjArray(indexMAX);
- for(index=0;index<indexMAX;index++){
- fITSmodules->AddAt( new AliITSmodule(index),index);
- } // end for index
- }else{
- fITSmodules = new TObjArray(size);
- for(index=0;index<size;index++) {
- fITSmodules->AddAt( new AliITSmodule(index),index);
- } // end for index
- nmodules = size;
- } // end i size<=0
-}
//______________________________________________________________________
void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
Option_t *option, const char *filename){
- // fill the modules with the sorted by module hits; add hits from
- // background if option=Add.
- // Inputs:
- // Int_t evnt Event to be processed.
- // Int_t bgrev Background Hit tree number.
- // Int_t nmodules Not used.
- // Option_t *option String indicating if merging hits or not. To
- // merge hits set equal to "Add". Otherwise no
- // background hits are considered.
- // Test_t *filename File name containing the background hits..
- // Outputs:
- // none.
- // Return:
- // none.
- static TTree *trH1; //Tree with background hits
- static Bool_t first=kTRUE;
- static TFile *file;
- const char *addBgr = strstr(option,"Add");
-
- evnt = nmodules; // Dummy use of variables to remove warnings
- if (addBgr ) {
- if(first) {
- file=new TFile(filename);
- } // end if first
- first=kFALSE;
- file->cd();
- file->ls();
- // Get Hits Tree header from file
- if(trH1) delete trH1;
- trH1=0;
-
- char treeName[20];
- sprintf(treeName,"TreeH%d",bgrev);
- trH1 = (TTree*)gDirectory->Get(treeName);
- if (!trH1) {
- Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
- } // end if !trH1
- // Set branch addresses
- } // end if addBgr
-
- FillModules(fLoader->TreeH(),0); // fill from this file's tree.
+ // fill the modules with the sorted by module hits; add hits from
+ // background if option=Add.
+
+ static TTree *trH1; //Tree with background hits
+ static Bool_t first=kTRUE;
+ static TFile *file;
+ const char *addBgr = strstr(option,"Add");
+
+ evnt = nmodules; // Dummy use of variables to remove warnings
+ if (addBgr ) {
+ if(first) {
+ file=new TFile(filename);
+ } // end if first
+ first=kFALSE;
+ file->cd();
+ file->ls();
+ // Get Hits Tree header from file
+ if(trH1) delete trH1;
+ trH1=0;
+
+ char treeName[20];
+ sprintf(treeName,"TreeH%d",bgrev);
+ trH1 = (TTree*)gDirectory->Get(treeName);
+ if (!trH1) {
+ Error("FillModules","cannot find Hits Tree for event:%d",bgrev);
+ } // end if !trH1
+ // Set branch addresses
+ } // end if addBgr
+
+ FillModules(fLoader->TreeH(),0); // fill from this file's tree.
- if (addBgr ) {
- FillModules(trH1,10000000); // Default mask 10M.
- TTree *fAli=fLoader->GetRunLoader()->TreeK();
- TFile *fileAli=0;
- if (fAli) fileAli =fAli->GetCurrentFile();
- fileAli->cd();
- } // end if add
+ if (addBgr ) {
+ FillModules(trH1,10000000); // Default mask 10M.
+ TTree *fAli=fLoader->GetRunLoader()->TreeK();
+ TFile *fileAli=0;
+ if (fAli) fileAli =fAli->GetCurrentFile();
+ fileAli->cd();
+ } // end if add
+
+
}
+
+
//______________________________________________________________________
void AliITS::FillModules(TTree *treeH, Int_t mask) {
// fill the modules with the sorted by module hits;
for(h=0; h<nHits; h++){
itsHit = (AliITShit *)fHits->UncheckedAt(h);
itsHit->GetDetectorID(lay,lad,det);
- if (fITSgeom) {
- index = fITSgeom->GetModuleIndex(lay,lad,det);
+ if (GetITSgeom()) {
+ index = GetITSgeom()->GetModuleIndex(lay,lad,det);
} else {
index=det-1; // This should not be used.
} // end if [You must have fITSgeom for this to work!]
} // end loop over hits
} // end loop over tracks
}
+
//______________________________________________________________________
-void AliITS::MakeBranchS(const char *fl){
- // Creates Tree Branch for the ITS summable digits.
+void AliITS::InitModules(Int_t size,Int_t &nmodules){
+ // Initialize the modules array.
// Inputs:
- // cont char *fl File name where SDigits branch is to be written
- // to. If blank it write the SDigits to the same
- // file in which the Hits were found.
+ // Int_t size Size of array of the number of modules to be
+ // created. If size <=0 then the number of modules
+ // is gotten from AliITSgeom class kept in fITSgeom.
// Outputs:
- // none.
+ // Int_t &nmodules The number of modules existing.
// Return:
// none.
- Int_t buffersize = 4000;
- char branchname[30];
- // only one branch for SDigits.
- sprintf(branchname,"%s",GetName());
-
+ if(fITSmodules){
+ fITSmodules->Delete();
+ delete fITSmodules;
+ } // end fir fITSmoudles
- if(fLoader->TreeS()){
- if(fSDigits==0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
- MakeBranchInTree(fLoader->TreeS(),branchname,&fSDigits,buffersize,fl);
- } // end if
-}
-//______________________________________________________________________
-void AliITS::SetTreeAddressS(TTree *treeS){
- // Set branch address for the ITS summable digits Trees.
- // Inputs:
- // TTree *treeS Tree containing the SDigits.
- // Outputs:
- // none.
- // Return:
- // none.
- char branchname[30];
+ if(!fDetTypeSim) {
+ Error("InitModules","fDetTypeSim is null!");
+ return;
+ }
- if(!treeS) return;
- if (fSDigits == 0x0) fSDigits = new TClonesArray("AliITSpListItem",1000);
- TBranch *branch;
- sprintf(branchname,"%s",GetName());
- branch = treeS->GetBranch(branchname);
- if (branch) branch->SetAddress(&fSDigits);
-}
-//______________________________________________________________________
-void AliITS::MakeBranchInTreeD(TTree *treeD,const char *file){
- // Creates Tree branches for the ITS.
- // Inputs:
- // TTree *treeD Pointer to the Digits Tree.
- // cont char *file File name where Digits branch is to be written
- // to. If blank it write the SDigits to the same
- // file in which the Hits were found.
- // Outputs:
- // none.
- // Return:
- // none.
- // one branch for digits per type of detector
- const Char_t *det[3] = {"SPD","SDD","SSD"};
- TString digclass;
- Int_t i;
- Int_t buffersize = 4000;
- Char_t branchname[30];
-
- if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
- for (i=0; i<kNTYPES ;i++) {
- digclass = DetType(i)->GetDigitClassName();
- // digits
- if(!(fDtype->At(i))){
- fDtype->AddAt(new TClonesArray(digclass.Data(),1000),i);
- }else{
- ResetDigits(i);
- } // end if
- if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
- else sprintf(branchname,"%sDigits%d",GetName(),i+1);
- if (fDtype && treeD) {
- MakeBranchInTree(treeD,branchname,&((*fDtype)[i]),buffersize,file);
- } // end if
- } // end for i
- /*
- for (i=0; i<kNTYPES ;i++) {
- if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
- else sprintf(branchname,"%sDigits%d",GetName(),i+1);
- if (fDtype && treeD) {
- MakeBranchInTree(treeD,branchname,&((*fDtype)[i]),buffersize,file);
- } // end if
- } // end for i
- */
-}
-//______________________________________________________________________
-void AliITS::SetTreeAddressD(TTree *treeD){
- // Set branch address for the Trees.
- // Inputs:
- // TTree *treeD Tree containing the Digits.
- // Outputs:
- // none.
- // Return:
- // none.
- const char *det[3] = {"SPD","SDD","SSD"};
- TBranch *branch;
- TString digclass;
- Int_t i;
- char branchname[30];
-
- if(!treeD) return;
- if (fDtype == 0x0) fDtype = new TObjArray(fNDetTypes);
- for (i=0; i<kNTYPES; i++) {
- digclass = DetType(i)->GetDigitClassName();
- // digits
- if(!(fDtype->At(i))) {
- fDtype->AddAt(new TClonesArray(digclass.Data(),1000),i);
- }else{
- ResetDigits(i);
- } // end if
- if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]);
- else sprintf(branchname,"%sDigits%d",GetName(),i+1);
- if (fDtype) {
- branch = treeD->GetBranch(branchname);
- if (branch) branch->SetAddress(&((*fDtype)[i]));
- } // end if fDtype
- } // end for i
+ Int_t nl,indexMAX,index;
+
+ if(size<=0){ // default to using data stored in AliITSgeom
+ if(fDetTypeSim->GetITSgeom()==0) {
+ Error("InitModules","fITSgeom not defined");
+ return;
+ } // end if fITSgeom==0
+ nl = fDetTypeSim->GetITSgeom()->GetNlayers();
+ indexMAX = fDetTypeSim->GetITSgeom()->GetIndexMax();
+ nmodules = indexMAX;
+ fITSmodules = new TObjArray(indexMAX);
+ for(index=0;index<indexMAX;index++){
+ fITSmodules->AddAt( new AliITSmodule(index),index);
+ } // end for index
+ }else{
+ fITSmodules = new TObjArray(size);
+ for(index=0;index<size;index++) {
+ fITSmodules->AddAt( new AliITSmodule(index),index);
+ } // end for index
+
+ nmodules = size;
+ } // end i size<=0
}
//______________________________________________________________________
void AliITS::Hits2SDigits(){
// none.
// Outputs:
// none.
+
- fLoader->LoadHits("read");
- fLoader->LoadSDigits("recreate");
- AliRunLoader* rl = fLoader->GetRunLoader();
-
- for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
+ if(!fDetTypeSim) {
+ Error("Hits2SDigits","fDetTypeSim is null!");
+ return;
+
+ }
+
+ SetDefaults();
+ fLoader->LoadHits("read");
+ fLoader->LoadSDigits("recreate");
+ AliRunLoader* rl = fLoader->GetRunLoader();
+ fDetTypeSim->SetLoader(fLoader);
+ for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
// Do the Hits to Digits operation. Use Standard input values.
// Event number from file, no background hit merging , use size from
// AliITSgeom class, option="All", input from this file only.
- rl->GetEvent(iEvent);
- if (!fLoader->TreeS()) fLoader->MakeTree("S");
- MakeBranch("S");
- SetTreeAddress();
- HitsToPreDigits(iEvent,0,-1," ",fOpt," ");
- } // end for iEvent
-
- fLoader->UnloadHits();
- fLoader->UnloadSDigits();
-}
-//______________________________________________________________________
-void AliITS::SDigitsToDigits(Option_t *opt){
- // Standard Summable digits to Digits function.
- // Inputs:
- // none.
- // Outputs:
- // none.
- char name[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
- if(!GetITSgeom()) return; // need transformations to do digitization.
- AliITSgeom *geom = GetITSgeom();
-
- const char *all = strstr(opt,"All");
- const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
- strstr(opt,"SSD")};
- if( !det[0] && !det[1] && !det[2] ) all = "All";
- else all = 0;
- static Bool_t setDef = kTRUE;
- if(setDef) SetDefaultSimulation();
- setDef = kFALSE;
-
- AliITSsimulation *sim = 0;
- AliITSDetType *iDetType = 0;
- TTree *trees = fLoader->TreeS();
- if( !(trees && this->GetSDigits()) ){
- Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
- return;
- } // end if
- sprintf( name, "%s", this->GetName() );
- TBranch *brchSDigits = trees->GetBranch( name );
-
- Int_t id,module;
- for(module=0;module<geom->GetIndexMax();module++){
- id = geom->GetModuleType(module);
- if (!all && !det[id]) continue;
- iDetType = DetType(id);
- sim = (AliITSsimulation*)iDetType->GetSimulationModel();
- if (!sim) {
- Error("SDigit2Digits","The simulation class was not "
- "instanciated for module %d type %s!",module,
- geom->GetModuleTypeName(module));
- exit(1);
- } // end if !sim
- sim->InitSimulationModule(module,gAlice->GetEvNumber());
- //
- // add summable digits to module
- this->GetSDigits()->Clear();
- brchSDigits->GetEvent(module);
- sim->AddSDigitsToModule(GetSDigits(),0);
- //
- // Digitise current module sum(SDigits)->Digits
- sim->FinishSDigitiseModule();
-
- // fills all branches - wasted disk space
- fLoader->TreeD()->Fill();
- this->ResetDigits();
- } // end for module
-
- fLoader->TreeD()->GetEntries();
-
- fLoader->TreeD()->AutoSave();
- // reset tree
- fLoader->TreeD()->Reset();
+ rl->GetEvent(iEvent);
+ if (!fLoader->TreeS()) fLoader->MakeTree("S");
+ MakeBranch("S");
+ SetTreeAddress();
+ HitsToPreDigits(iEvent,0,-1," ",fOpt," ");
+ } // end for iEvent
+ fLoader->UnloadHits();
+ fLoader->UnloadSDigits();
+
}
//______________________________________________________________________
void AliITS::Hits2Digits(){
- // Standard Hits to Digits function.
- // Inputs:
- // none.
- // Outputs:
- // none.
- fLoader->LoadHits("read");
- fLoader->LoadDigits("recreate");
- AliRunLoader* rl = fLoader->GetRunLoader();
-
- for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
- // Do the Hits to Digits operation. Use Standard input values.
- // Event number from file, no background hit merging , use size from
- // AliITSgeom class, option="All", input from this file only.
- rl->GetEvent(iEvent);
- if (!fLoader->TreeD()) fLoader->MakeTree("D");
- MakeBranch("D");
- SetTreeAddress();
- HitsToDigits(iEvent,0,-1," ",fOpt," ");
- } // end for iEvent
-
- fLoader->UnloadHits();
- fLoader->UnloadDigits();
+ //Conversion from hits to digits
+ if(!fDetTypeSim) {
+ Error("Hits2SDigits","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->SetLoader(fLoader);
+ SetDefaults();
+
+ fLoader->LoadHits("read");
+ fLoader->LoadDigits("recreate");
+ AliRunLoader* rl = fLoader->GetRunLoader();
+ for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
+ rl->GetEvent(iEvent);
+ if (!fLoader->TreeD()) fLoader->MakeTree("D");
+ MakeBranch("D");
+ SetTreeAddress();
+ HitsToDigits(iEvent,0,-1," ",fOpt," ");
+ }
+
+ fLoader->UnloadHits();
+ fLoader->UnloadDigits();
+
}
+
//______________________________________________________________________
-void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
- Option_t *option,Option_t *opt,
- const char *filename){
+void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
+ Option_t *option,Option_t *opt,
+ const char *filename){
// Keep galice.root for signal and name differently the file for
// background when add! otherwise the track info for signal will be lost !
// the condition below will disappear when the geom class will be
// Return:
// none.
- if(!GetITSgeom()) return; // need transformations to do digitization.
- AliITSgeom *geom = GetITSgeom();
-
- const char *all = strstr(opt,"All");
- const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
- strstr(opt,"SSD")};
- static Bool_t setDef=kTRUE;
- if (setDef) SetDefaultSimulation();
- setDef=kFALSE;
-
- Int_t nmodules;
- InitModules(size,nmodules);
- FillModules(evNumber,bgrev,nmodules,option,filename);
-
- AliITSsimulation *sim = 0;
- AliITSDetType *iDetType = 0;
- AliITSmodule *mod = 0;
- Int_t id,module;
- for(module=0;module<geom->GetIndexMax();module++){
- id = geom->GetModuleType(module);
- if (!all && !det[id]) continue;
- iDetType = DetType(id);
- sim = (AliITSsimulation*)iDetType->GetSimulationModel();
- if (!sim) {
- Error("HitsToSDigits","The simulation class was not "
- "instanciated for module %d type %s!",module,
- geom->GetModuleTypeName(module));
- exit(1);
- } // end if !sim
- mod = (AliITSmodule *)fITSmodules->At(module);
- sim->SDigitiseModule(mod,module,evNumber);
- // fills all branches - wasted disk space
- fLoader->TreeS()->Fill();
- ResetSDigits();
- } // end for module
-
- ClearModules();
-
- fLoader->TreeS()->GetEntries();
- fLoader->TreeS()->AutoSave();
- fLoader->WriteSDigits("OVERWRITE");
- // reset tree
- fLoader->TreeS()->Reset();
+ if(!fDetTypeSim) {
+ Error("HitsToDigits","fDetTypeSim is null!");
+ return;
+ }
+ fDetTypeSim->SetLoader(fLoader);
+ if(!GetITSgeom()) return; // need transformations to do digitization.
+ AliITSgeom *geom = GetITSgeom();
+
+ const char *all = strstr(opt,"All");
+ const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
+ strstr(opt,"SSD")};
+ static Bool_t setDef=kTRUE;
+ if (setDef) SetDefaultSimulation();
+ setDef=kFALSE;
+
+ Int_t nmodules;
+ InitModules(size,nmodules);
+ FillModules(evNumber,bgrev,nmodules,option,filename);
+
+ AliITSsimulation *sim = 0;
+ AliITSmodule *mod = 0;
+ Int_t id;
+ for(Int_t module=0;module<geom->GetIndexMax();module++){
+ id = geom->GetModuleType(module);
+ if (!all && !det[id]) continue;
+ sim = (AliITSsimulation*)fDetTypeSim->GetSimulationModel(id);
+ if (!sim) {
+ Error("HitsToDigits","The simulation class was not "
+ "instanciated for module %d type %s!",module,
+ geom->GetModuleTypeName(module));
+ exit(1);
+ } // end if !sim
+ mod = (AliITSmodule *)fITSmodules->At(module);
+ sim->DigitiseModule(mod,module,evNumber);
+ // fills all branches - wasted disk space
+ fLoader->TreeD()->Fill();
+ ResetDigits();
+ } // end for module
+
+ ClearModules();
+
+ fLoader->TreeD()->GetEntries();
+ fLoader->TreeD()->AutoSave();
+ // reset tree
+ fLoader->TreeD()->Reset();
}
+//_____________________________________________________________________
+void AliITS::Hits2PreDigits(){
+ // Turn hits into SDigits
+
+ if(!fDetTypeSim) {
+ Error("Hits2SDigits","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->SetLoader(fLoader);
+ SetDefaults();
+
+ HitsToPreDigits(fLoader->GetRunLoader()->GetEventNumber(),
+ 0,-1," ",fOpt," ");
+}
+
//______________________________________________________________________
-void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
- Option_t *option,Option_t *opt,
- const char *filename){
+void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
+ Option_t *option,Option_t *opt,
+ const char *filename){
// Keep galice.root for signal and name differently the file for
// background when add! otherwise the track info for signal will be lost !
// the condition below will disappear when the geom class will be
// Return:
// none.
+
+ if(!fDetTypeSim) {
+ Error("HitsToPreDigits","fDetTypeSim is null!");
+ return;
+ }
+ fDetTypeSim->SetLoader(fLoader);
+
+ if(!GetITSgeom()){
+ Error("HitsToPreDigits","fGeom is null!");
+ return; // need transformations to do digitization.
+ }
+ AliITSgeom *geom = GetITSgeom();
+
+ const char *all = strstr(opt,"All");
+ const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
+ strstr(opt,"SSD")};
+ static Bool_t setDef=kTRUE;
+ if (setDef) SetDefaultSimulation();
+ setDef=kFALSE;
+
+ Int_t nmodules;
+ InitModules(size,nmodules);
+ FillModules(evNumber,bgrev,nmodules,option,filename);
+
+
+ AliITSsimulation *sim = 0;
+ AliITSmodule *mod = 0;
+ Int_t id,module;
+ for(module=0;module<geom->GetIndexMax();module++){
+ id = geom->GetModuleType(module);
+ if (!all && !det[id]) continue;
+ sim = (AliITSsimulation*)GetSimulationModel(id);
+ if (!sim) {
+ Error("HitsToPreDigits","The simulation class was not "
+ "instanciated for module %d type %s!",module,
+ geom->GetModuleTypeName(module));
+ exit(1);
+ } // end if !sim
+ mod = (AliITSmodule *)fITSmodules->At(module);
+ sim->SDigitiseModule(mod,module,evNumber);
+ // fills all branches - wasted disk space
+ fLoader->TreeS()->Fill();
+ fDetTypeSim->ResetSDigits();
+ } // end for module
- if(!GetITSgeom()) return; // need transformations to do digitization.
- AliITSgeom *geom = GetITSgeom();
-
- const char *all = strstr(opt,"All");
- const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
- strstr(opt,"SSD")};
- static Bool_t setDef=kTRUE;
- if (setDef) SetDefaultSimulation();
- setDef=kFALSE;
-
- Int_t nmodules;
- InitModules(size,nmodules);
- FillModules(evNumber,bgrev,nmodules,option,filename);
-
- AliITSsimulation *sim = 0;
- AliITSDetType *iDetType = 0;
- AliITSmodule *mod = 0;
- Int_t id,module;
- for(module=0;module<geom->GetIndexMax();module++){
- id = geom->GetModuleType(module);
- if (!all && !det[id]) continue;
- iDetType = DetType(id);
- sim = (AliITSsimulation*)iDetType->GetSimulationModel();
- if (!sim) {
- Error("HitsToDigits","The simulation class was not "
- "instanciated for module %d type %s!",module,
- geom->GetModuleTypeName(module));
- exit(1);
- } // end if !sim
- mod = (AliITSmodule *)fITSmodules->At(module);
- sim->DigitiseModule(mod,module,evNumber);
- // fills all branches - wasted disk space
- fLoader->TreeD()->Fill();
- ResetDigits();
- } // end for module
-
- ClearModules();
-
- fLoader->TreeD()->GetEntries();
- fLoader->TreeD()->AutoSave();
- // reset tree
- fLoader->TreeD()->Reset();
+ ClearModules();
+
+
+ fLoader->TreeS()->GetEntries();
+ fLoader->TreeS()->AutoSave();
+ fLoader->WriteSDigits("OVERWRITE");
+ // reset tree
+ fLoader->TreeS()->Reset();
}
+
+//_____________________________________________________________________
+void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
+ Option_t *opt0,Option_t *opt1,
+ const char *flnm){
+ // keep galice.root for signal and name differently the file for
+ // background when add! otherwise the track info for signal will be lost !
+ // the condition below will disappear when the geom class will be
+ // initialized for all versions - for the moment it is only for v5 !
+ // Inputs:
+ // Int_t evnt Event to be processed.
+ // Int_t bgrev Background Hit tree number.
+ // Int_t size Size used by InitModules. See InitModules.
+ // Option_t *opt0 Option passed to FillModules. See FillModules.
+ // Option_t *opt1 String indicating if merging hits or not. To
+ // merge hits set equal to "Add". Otherwise no
+ // background hits are considered.
+ // Test_t *flnm File name containing the background hits..
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+
+ if(!GetITSgeom()){
+ Error("HitsToPreDigits","fGeom is null!");
+ return; // need transformations to do digitization.
+ }
+ AliITSgeom *geom = GetITSgeom();
+
+ AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
+
+ const char *all = strstr(opt1,"All");
+ const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
+ strstr(opt1,"SSD")};
+ Int_t nmodules;
+ InitModules(size,nmodules);
+ FillModules(evNumber,bgrev,nmodules,opt0,flnm);
+
+ AliITSsimulation *sim = 0;
+ AliITSmodule *mod = 0;
+ Int_t id,module;
+
+ TTree *lTR = pITSloader->TreeR();
+ TBranch* branch = lTR->GetBranch("ITSRecPointsF");
+ TClonesArray* ptarray = new TClonesArray("AliITSRecPoint",1000);
+ if(branch) branch->SetAddress(ptarray);
+ else lTR->Branch("ITSRecPointsF",&ptarray);
+
+
+ //m.b. : this change is nothing but a nice way to make sure
+ //the CPU goes up !
+ AliDebug(1,Form("N mod = %d",geom->GetIndexMax()));
+ for(module=0;module<geom->GetIndexMax();module++){
+ id = geom->GetModuleType(module);
+ if (!all && !det[id]) continue;
+ sim = (AliITSsimulation*)GetSimulationModel(id);
+ if (!sim) {
+ Error("HitsToFastPoints","The simulation class was not "
+ "instanciated for module %d type %x!",module,
+ geom->GetModuleTypeName(module));
+ exit(1);
+ } // end if !sim
+ mod = (AliITSmodule *)fITSmodules->At(module);
+ sim->CreateFastRecPoints(mod,module,gRandom,ptarray);
+ lTR->Fill();
+ } // end for module
+
+ ClearModules();
+ fLoader->WriteRecPoints("OVERWRITE");
+ delete ptarray;
+}
+//_____________________________________________________________________
+Int_t AliITS::Hits2Clusters(TTree *hTree, TTree *cTree) {
+ //------------------------------------------------------------
+ // This function creates ITS clusters
+ //------------------------------------------------------------
+ if(!GetITSgeom()){
+ Error("HitsToPreDigits","fGeom is null!");
+ return 1; // need transformations to do digitization.
+ }
+ AliITSgeom *geom=GetITSgeom();
+ Int_t mmax=geom->GetIndexMax();
+
+ InitModules(-1,mmax);
+ FillModules(hTree,0);
+
+ TClonesArray *clusters=new TClonesArray("AliITSclusterV2",1000);
+ TBranch *branch=cTree->GetBranch("Clusters");
+ if (!branch) cTree->Branch("Clusters",&clusters);
+ else branch->SetAddress(&clusters);
+
+ TClonesArray *points = new TClonesArray("AliITSRecPoint",1000);
+
+ AliITSsimulationFastPoints sim;
+ Int_t ncl=0;
+ for (Int_t m=0; m<mmax; m++) {
+ AliITSmodule *mod=GetModule(m);
+ sim.CreateFastRecPoints(mod,m,gRandom,points);
+ RecPoints2Clusters(points, m, clusters);
+ ncl+=clusters->GetEntriesFast();
+ cTree->Fill();
+ clusters->Clear();
+ points->Clear();
+ }
+
+ Info("Hits2Clusters","Number of found fast clusters : %d",ncl);
+
+ //cTree->Write();
+
+ delete clusters;
+ delete points;
+ return 0;
+}
+//_____________________________________________________________________
+void AliITS::RecPoints2Clusters
+(const TClonesArray *points, Int_t idx, TClonesArray *clusters) {
+ //------------------------------------------------------------
+ // Conversion AliITSRecPoint -> AliITSclusterV2 for the ITS
+ // subdetector indexed by idx
+ //------------------------------------------------------------
+
+ if(!GetITSgeom()){
+ Error("HitsToPreDigits","fGeom is null!");
+ return; // need transformations to do digitization.
+ }
+ AliITSgeom *g=GetITSgeom();
+ Int_t mmax = g->GetIndexMax();
+ Float_t yshift[2200];
+ Float_t zshift[2200];
+ Int_t ndet[2200];
+ for (Int_t m=0; m<mmax; m++) {
+ Int_t lay,lad,det; g->GetModuleId(m,lay,lad,det);
+ Float_t x,y,z; g->GetTrans(lay,lad,det,x,y,z);
+ Double_t rot[9]; g->GetRotMatrix(lay,lad,det,rot);
+ Double_t alpha=TMath::ATan2(rot[1],rot[0])+TMath::Pi();
+ Double_t ca=TMath::Cos(alpha), sa=TMath::Sin(alpha);
+ yshift[m] = x*ca + y*sa;
+ zshift[m] = (Double_t)z;
+ ndet[m] = (lad-1)*g->GetNdetectors(lay) + (det-1);
+ }
+
+ //SPD geometry
+ Float_t lastSPD1=g->GetModuleIndex(2,1,1)-1;
+
+ TClonesArray &cl=*clusters;
+ Int_t ncl=points->GetEntriesFast();
+ for (Int_t i=0; i<ncl; i++) {
+ AliITSRecPoint *p = (AliITSRecPoint *)points->UncheckedAt(i);
+ Float_t lp[5];
+ lp[0]=-(-p->GetX()+yshift[idx]); if (idx<=lastSPD1) lp[0]*=-1; //SPD1
+ lp[1]= -p->GetZ()+zshift[idx];
+ lp[2]=p->GetSigmaX2();
+ lp[3]=p->GetSigmaZ2();
+ lp[4]=p->GetQ()*36./23333.; //electrons -> ADC
+ Int_t lab[4];
+ lab[0]=p->GetLabel(0); lab[1]=p->GetLabel(1); lab[2]=p->GetLabel(2);
+ lab[3]=ndet[idx];
+ CheckLabels(lab);
+ Int_t dummy[3]={0,0,0};
+ new (cl[i]) AliITSclusterV2(lab,lp, dummy);
+ }
+}
+//_____________________________________________________________________
+void AliITS::CheckLabels(Int_t lab[3]) const {
+ //------------------------------------------------------------
+ // Tries to find mother's labels
+ //------------------------------------------------------------
+
+ if(lab[0]<0 && lab[1]<0 && lab[2]<0) return; // In case of no labels just exit
+
+ Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
+ for (Int_t i=0;i<3;i++){
+ Int_t label = lab[i];
+ if (label>=0 && label<ntracks) {
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ if (part->P() < 0.005) {
+ Int_t m=part->GetFirstMother();
+ if (m<0) {
+ continue;
+ }
+ if (part->GetStatusCode()>0) {
+ continue;
+ }
+ lab[i]=m;
+ }
+ }
+ }
+
+}
+
+//______________________________________________________________________
+void AliITS::SDigitsToDigits(Option_t *opt){
+ // Standard Summable digits to Digits function.
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ if(!fDetTypeSim) {
+ Error("SDigitsToSDigits","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->SetLoader(fLoader);
+ SetDefaults();
+ fDetTypeSim->SDigitsToDigits(opt,(Char_t*)GetName());
+
+}
+
//______________________________________________________________________
void AliITS::ResetDigits(){
// Reset number of digits and the digits array for the ITS detector.
// none.
// Outputs:
// none.
+ if(!fDetTypeSim) {
+ Error("ResetDigits","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->ResetDigits();
- if (!fDtype) return;
- Int_t i;
- for (i=0;i<kNTYPES;i++ ) {
- ResetDigits(i);
- } // end for i
}
//______________________________________________________________________
-void AliITS::ResetDigits(Int_t i){
+void AliITS::ResetDigits(Int_t branch){
// Reset number of digits and the digits array for this branch.
// Inputs:
// none.
// Outputs:
// none.
- if (fDtype->At(i)) ((TClonesArray*)fDtype->At(i))->Clear();
- if (fNdtype) fNdtype[i]=0;
+ if(!fDetTypeSim) {
+ Error("ResetDigits","fDetTypeSim is 0!");
+ return;
+ }
+
+ fDetTypeSim->ResetDigits(branch);
+
}
//______________________________________________________________________
void AliITS::AddSumDigit(AliITSpListItem &sdig){
// Return:
// none.
- TClonesArray &lsdig = *fSDigits;
- new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
+ if(!fDetTypeSim) {
+ Error("AddSumDigit","fDetTypeSim is 0!");
+ return;
+ }
+ fDetTypeSim->AddSumDigit(sdig);
+
}
//______________________________________________________________________
-void AliITS::AddRealDigit(Int_t id, Int_t *digits){
+void AliITS::AddRealDigit(Int_t branch, Int_t *digits){
// Add a real digit - as coming from data.
// Inputs:
// Int_t id Detector type number.
// Return:
// none.
- TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
- new(ldigits[fNdtype[id]++]) AliITSdigit(digits);
+ if(!fDetTypeSim) {
+ Error("AddRealDigit","fDetTypeSim is 0!");
+ return;
+ }
+ fDetTypeSim->AddRealDigit(branch,digits);
+
}
//______________________________________________________________________
-void AliITS::AddSimDigit(Int_t id, AliITSdigit *d){
+void AliITS::AddSimDigit(Int_t branch, AliITSdigit *d){
// Add a simulated digit.
// Inputs:
// Int_t id Detector type number.
// Return:
// none.
- TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
-
- switch(id){
- case 0:
- new(ldigits[fNdtype[id]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
- break;
- case 1:
- new(ldigits[fNdtype[id]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
- break;
- case 2:
- new(ldigits[fNdtype[id]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
- break;
- } // end switch id
+ if(!fDetTypeSim) {
+ Error("AddSimDigit","fDetTypeSim is 0!");
+ return;
+ }
+ fDetTypeSim->AddSimDigit(branch,d);
+
}
//______________________________________________________________________
-void AliITS::AddSimDigit(Int_t id,Float_t phys,Int_t *digits,Int_t *tracks,
+void AliITS::AddSimDigit(Int_t branch,Float_t phys,Int_t *digits,Int_t *tracks,
Int_t *hits,Float_t *charges){
// Add a simulated digit to the list.
// Inputs:
// Return:
// none.
- TClonesArray &ldigits = *((TClonesArray*)fDtype->At(id));
- AliITSresponseSDD *resp = 0;
- switch(id){
- case 0:
- new(ldigits[fNdtype[id]++]) AliITSdigitSPD(digits,tracks,hits);
- break;
- case 1:
- resp = (AliITSresponseSDD*)DetType(1)->GetResponseModel();
- new(ldigits[fNdtype[id]++]) AliITSdigitSDD(phys,digits,tracks,
- hits,charges,resp);
- break;
- case 2:
- new(ldigits[fNdtype[id]++]) AliITSdigitSSD(digits,tracks,hits);
- break;
- } // end switch id
+ if(!fDetTypeSim) {
+ Error("AddSimDigit","fDetTypeSim is 0!");
+ return;
+ }
+ fDetTypeSim->AddSimDigit(branch,phys,digits,tracks,hits,charges);
+
}
//______________________________________________________________________
void AliITS::Digits2Raw(){
// convert digits of the current event to raw data
- fLoader->LoadDigits();
- TTree* digits = fLoader->TreeD();
+ if(!fDetTypeSim) {
+ Error("Digits2Raw","fDetTypeSim is 0!");
+ return;
+ }
+ fDetTypeSim->SetLoader(fLoader);
+ SetDefaults();
+ fDetTypeSim->GetLoader()->LoadDigits();
+ TTree* digits = fDetTypeSim->GetLoader()->TreeD();
if (!digits) {
Error("Digits2Raw", "no digits tree");
return;
}
- SetTreeAddressD(digits);
+ fDetTypeSim->SetTreeAddressD(digits,(Char_t*)GetName());
AliITSDDLRawData rawWriter;
//Verbose level
rawWriter.RawDataSSD(digits->GetBranch("ITSDigitsSSD"));
fLoader->UnloadDigits();
-}
-
-//______________________________________________________________________
-void AliITS::MakeTreeC(Option_t *option){
- // Create a separate tree to store the clusters.
- // Inputs:
- // Option_t *option string which must contain "C" otherwise
- // no Cluster Tree is created.
- // Outputs:
- // none.
- // Return:
- // none.
-
- AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
-
- if (pITSLoader == 0x0) {
- Error("MakeTreeC","fLoader == 0x0 option=%s",option);
- return;
- }
- if (pITSLoader->TreeC() == 0x0) pITSLoader->MakeTree("C");
- MakeBranchC();
-}
-//----------------------------------------------------------------------
-void AliITS::MakeBranchC(){
- //Makes barnches in treeC
- AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
- if (pITSLoader == 0x0) {
- Error("MakeTreeC","fLoader == 0x0");
- return;
- }
- TTree * lTC = pITSLoader->TreeC();
- if (lTC == 0x0){
- Error("MakeTreeC","Can not get TreeC from Loader");
- return;
- }
-
- Int_t buffersize = 4000;
- char branchname[30];
- const char *det[3] = {"SPD","SDD","SSD"};
- char digclass[40];
- char clclass[40];
-
- // one branch for Clusters per type of detector
- Int_t i;
- for (i=0; i<kNTYPES ;i++) {
- AliITSDetType *iDetType=DetType(i);
- iDetType->GetClassNames(digclass,clclass);
- // clusters
- if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
- if(!ClustersAddress(i)){
- fCtype->AddAt(new TClonesArray(clclass,1000),i);
- }
- if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
- else sprintf(branchname,"%sClusters%d",GetName(),i+1);
- if (fCtype && lTC) {
- if (lTC->GetBranch(branchname)){
- Warning("MakeBranchC","Branch %s alread exists in TreeC",
- branchname);
- }else{
- Info("MakeBranchC","Creating branch %s in TreeC",branchname);
- lTC->Branch(branchname,&((*fCtype)[i]), buffersize);
- }
- } // end if fCtype && lTC
- } // end for i
-}
-//______________________________________________________________________
-void AliITS::GetTreeC(Int_t event){
- // Get the clusters tree for this event and set the branch address.
- // Inputs:
- // Int_t event Event number for the cluster tree.
- // Outputs:
- // none.
- // Return:
- // none.
- char branchname[30];
- const char *det[3] = {"SPD","SDD","SSD"};
-
- AliITSLoader *pITSLoader = (AliITSLoader*)fLoader;
- TTree * lTC = pITSLoader->TreeC();
-
- ResetClusters();
- if (lTC) {
- pITSLoader->CleanRawClusters();
- } // end if TreeC()
-
- TBranch *branch;
-
- if (lTC) {
- Int_t i;
- char digclass[40];
- char clclass[40];
- for (i=0; i<kNTYPES; i++) {
- AliITSDetType *iDetType=DetType(i);
- iDetType->GetClassNames(digclass,clclass);
- // clusters
- if (fCtype == 0x0) fCtype = new TObjArray(fNDetTypes);
- if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(clclass,1000),i);
- if(kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
- else sprintf(branchname,"%sClusters%d",GetName(),i+1);
- if (fCtype) {
- branch = lTC->GetBranch(branchname);
- if (branch) branch->SetAddress(&((*fCtype)[i]));
- } // end if fCtype
- } // end for i
- } else {
- Error("GetTreeC","cannot find Clusters Tree for event:%d",event);
- } // end if lTC
-}
-//______________________________________________________________________
-void AliITS::AddCluster(Int_t id, AliITSRawCluster *c){
- // Add a cluster to the list.
- // Inputs:
- // Int_t id Detector type number.
- // AliITSRawCluster *c Cluster class to be added to the tree of
- // clusters.
- // Outputs:
- // none.
- // Return:
- // none.
-
- TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
-
- switch(id){
- case 0:
- new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
- break;
- case 1:
- new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
- break;
- case 2:
- new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
- break;
- } // end switch id
-}
-//______________________________________________________________________
-void AliITS::ResetClusters(Int_t i){
- // Reset number of clusters and the clusters array for this branch.
- // Inputs:
- // Int_t i Detector type number.
- // Outputs:
- // none.
- // Return:
- // none.
-
- if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
- if (fNctype) fNctype[i]=0;
-}
-//______________________________________________________________________
-void AliITS::MakeBranchR(const char *file, Option_t *opt){
- // Creates Tree branches for the ITS Reconstructed points.
- // Inputs:
- // cont char *file File name where RecPoints branch is to be written
- // to. If blank it write the SDigits to the same
- // file in which the Hits were found.
- // Outputs:
- // none.
- // Return:
- // none.
- Int_t buffsz = 4000;
- char branchname[30];
-
- // only one branch for rec points for all detector types
- Bool_t oFast= (strstr(opt,"Fast")!=0);
- Bool_t v2 = (strstr(opt,"v2")!=0);
-
-
- if(oFast){
- sprintf(branchname,"%sRecPointsF",GetName());
- } else if(v2){
- sprintf(branchname,"Clusters");
- } else {
- sprintf(branchname,"%sRecPoints",GetName());
- }
-
- if(v2){
-
- if(!fClustersV2)fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- if(fLoader->TreeR()){
- if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- MakeBranchInTree(fLoader->TreeR(),branchname,&fClustersV2,buffsz,file);
-
- }
- }else{
- if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
- if (fLoader->TreeR()) {
- if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
- 1000);
- MakeBranchInTree(fLoader->TreeR(),branchname,&fRecPoints,buffsz,file);
- } // end if
- }
-}
-//______________________________________________________________________
-void AliITS::SetTreeAddressR(TTree *treeR){
- // Set branch address for the Reconstructed points Trees.
- // Inputs:
- // TTree *treeR Tree containing the RecPoints.
- // Outputs:
- // none.
- // Return:
- // none.
- char branchname[30];
-
- if(!treeR) return;
- if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
- TBranch *branch1;
- sprintf(branchname,"Clusters");
- branch1 = treeR->GetBranch(branchname);
- if(branch1){
- if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
- branch1->SetAddress(&fClustersV2);
- }
- else{
- TBranch *branch;
- sprintf(branchname,"%sRecPoints",GetName());
- branch = treeR->GetBranch(branchname);
- if (branch) {
- branch->SetAddress(&fRecPoints);
- }else {
- sprintf(branchname,"%sRecPointsF",GetName());
- branch = treeR->GetBranch(branchname);
- if (branch) {
- branch->SetAddress(&fRecPoints);
- }
- }
- }
-}
-//______________________________________________________________________
-void AliITS::AddRecPoint(const AliITSRecPoint &r){
- // Add a reconstructed space point to the list
- // Inputs:
- // const AliITSRecPoint &r RecPoint class to be added to the tree
- // of reconstructed points TreeR.
- // Outputs:
- // none.
- // Return:
- // none.
-
- TClonesArray &lrecp = *fRecPoints;
- new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
-}
-//______________________________________________________________________
-void AliITS::AddClusterV2(const AliITSclusterV2 &r){
- // Add a reconstructed space point to the list
- // Inputs:
- // const AliITSClusterV2 &r class to be added to the tree
- // of reconstructed points TreeR.
- // Outputs:
- // none.
- // Return:
- // none.
-
- TClonesArray &lrecp = *fClustersV2;
- new(lrecp[fNClustersV2++]) AliITSclusterV2(r);
-}
-//______________________________________________________________________
-void AliITS::HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
- Option_t *opt0,Option_t *opt1,
- const char *flnm){
- // keep galice.root for signal and name differently the file for
- // background when add! otherwise the track info for signal will be lost !
- // the condition below will disappear when the geom class will be
- // initialized for all versions - for the moment it is only for v5 !
- // Inputs:
- // Int_t evnt Event to be processed.
- // Int_t bgrev Background Hit tree number.
- // Int_t size Size used by InitModules. See InitModules.
- // Option_t *opt0 Option passed to FillModules. See FillModules.
- // Option_t *opt1 String indicating if merging hits or not. To
- // merge hits set equal to "Add". Otherwise no
- // background hits are considered.
- // Test_t *flnm File name containing the background hits..
- // Outputs:
- // none.
- // Return:
- // none.
-
- if(!GetITSgeom()) return;
- AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
- AliITSgeom *geom = GetITSgeom();
-
- const char *all = strstr(opt1,"All");
- const char *det[3] ={strstr(opt1,"SPD"),strstr(opt1,"SDD"),
- strstr(opt1,"SSD")};
- Int_t nmodules;
- InitModules(size,nmodules);
- FillModules(evNumber,bgrev,nmodules,opt0,flnm);
+
- AliITSsimulation *sim = 0;
- AliITSDetType *iDetType = 0;
- AliITSmodule *mod = 0;
- Int_t id,module;
- //m.b. : this change is nothing but a nice way to make sure
- //the CPU goes up !
-
- AliDebug(1,Form("N mod = %d",geom->GetIndexMax()));
- for(module=0;module<geom->GetIndexMax();module++){
- id = geom->GetModuleType(module);
- if (!all && !det[id]) continue;
- iDetType = DetType(id);
- sim = (AliITSsimulation*)iDetType->GetSimulationModel();
- if (!sim) {
- Error("HitsToFastPoints","The simulation class was not "
- "instanciated for module %d type %x!",module,
- geom->GetModuleTypeName(module));
- exit(1);
- } // end if !sim
- mod = (AliITSmodule *)fITSmodules->At(module);
- sim->CreateFastRecPoints(mod,module,gRandom);
- cout<<module<<"\r";fflush(0);
- //gAlice->TreeR()->Fill();
- TTree *lTR = pITSloader->TreeR();
- TBranch *br=lTR->GetBranch("ITSRecPointsF");
- br->Fill();
- ResetRecPoints();
- } // end for module
-
- ClearModules();
- fLoader->WriteRecPoints("OVERWRITE");
+
}
-//______________________________________________________________________
-void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt){
- // cluster finding and reconstruction of space points
- // the condition below will disappear when the geom class will be
- // initialized for all versions - for the moment it is only for v5 !
- // 7 is the SDD beam test version
- // Inputs:
- // Int_t evNumber Event number to be processed.
- // Int_t lastentry Offset for module when not all of the modules
- // are processed.
- // Option_t *opt String indicating which ITS sub-detectors should
- // be processed. If ="All" then all of the ITS
- // sub detectors are processed.
- // Outputs:
- // none.
- // Return:
- // none.
- if(!GetITSgeom()) return;
- AliITSgeom *geom = GetITSgeom();
-
- const char *all = strstr(opt,"All");
- const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
- strstr(opt,"SSD")};
- static Bool_t setRec=kTRUE;
- if (setRec) SetDefaultClusterFinders();
- setRec=kFALSE;
- AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
- TTree *treeC=pITSloader->TreeC();
- AliITSClusterFinder *rec = 0;
- AliITSDetType *iDetType = 0;
- Int_t id,module,first=0;
- for(module=0;module<geom->GetIndexMax();module++){
- id = geom->GetModuleType(module);
- if (!all && !det[id]) continue;
- if(det[id]) first = geom->GetStartDet(id);
- iDetType = DetType(id);
- rec = (AliITSClusterFinder*)iDetType->GetReconstructionModel();
- TClonesArray *itsDigits = this->DigitsAddress(id);
- if (!rec) {
- Error("DigitsToRecPoints",
- "The reconstruction class was not instanciated! event=%d",
- evNumber);
- exit(1);
- } // end if !rec
- this->ResetDigits();
- TTree *lTD = pITSloader->TreeD();
- if (all) {
- lTD->GetEvent(lastentry+module);
- }else {
- lTD->GetEvent(lastentry+(module-first));
- }
- Int_t ndigits = itsDigits->GetEntriesFast();
- if(ndigits>0){
- rec->SetDigits(DigitsAddress(id));
- rec->SetClusters(ClustersAddress(id));
- rec->FindRawClusters(module);
- } // end if
- pITSloader->TreeR()->Fill();
- ResetRecPoints();
- ResetClustersV2();
- treeC->Fill();
- ResetClusters();
- } // end for module
-
- pITSloader->WriteRecPoints("OVERWRITE");
- pITSloader->WriteRawClusters("OVERWRITE");
-}
-//______________________________________________________________________
-void AliITS::DigitsToRecPoints(AliRawReader* rawReader){
- // cluster finding and reconstruction of space points
- // the condition below will disappear when the geom class will be
- // initialized for all versions - for the moment it is only for v5 !
- // 7 is the SDD beam test version
- // Inputs:
- // Int_t evNumber Event number to be processed.
- // Int_t lastentry Offset for module when not all of the modules
- // are processed.
- // Option_t *opt String indicating which ITS sub-detectors should
- // be processed. If ="All" then all of the ITS
- // sub detectors are processed.
- // Outputs:
- // none.
- // Return:
- // none.
- if(!GetITSgeom()) return;
- AliITSgeom *geom = GetITSgeom();
-
-
- SetDefaultClusterFindersV2();
-
- AliITSLoader *pITSloader = (AliITSLoader*)fLoader;
- AliITSClusterFinderV2 *rec = 0;
- AliITSDetType *iDetType = 0;
- Int_t id=0;
-
- if(!pITSloader->TreeR()) pITSloader->MakeTree("R");
- TTree* cTree = pITSloader->TreeR();
- TClonesArray *array=new TClonesArray("AliITSclusterV2",1000);
- cTree->Branch("Clusters",&array);
- delete array;
-
- TClonesArray** clusters = new TClonesArray*[geom->GetIndexMax()];
- for (Int_t iModule = 0; iModule < geom->GetIndexMax(); iModule++) {
- clusters[iModule] = NULL;
- }
- for(id=0;id<3;id++){
- iDetType = DetType(id);
- rec = (AliITSClusterFinderV2*)iDetType->GetReconstructionModel();
- if (!rec) {
- Error("DigitsToRecPoints",
- "The reconstruction class was not instanciated");
- exit(1);
- }
- rec->RawdataToClusters(rawReader,clusters);
- }
- Int_t nClusters =0;
- for(Int_t iModule=0;iModule<geom->GetIndexMax();iModule++){
- array = clusters[iModule];
- if(!array){
- Error("DigitsToRecPoints","data for module %d missing!",iModule);
- array = new TClonesArray("AliITSclusterV2");
- }
- cTree->SetBranchAddress("Clusters",&array);
- cTree->Fill();
- nClusters+=array->GetEntriesFast();
- delete array;
- }
- pITSloader->WriteRecPoints("OVERWRITE");
- delete[] clusters;
- Info("DigitsToRecPoints", "total number of found clustersV2 in ITS: %d\n",
- nClusters);
-
-}
//______________________________________________________________________
AliLoader* AliITS::MakeLoader(const char* topfoldername){
// Manager class for set: ITS //
////////////////////////////////////////////////////////////////////////
-//#define NEWVERSION
#include <TObjArray.h> // used in inline function GetModule.
-#include <TBranch.h> // used in inline function SetHitsAddressBranch
-
-#include "AliRunLoader.h"
#include "AliDetector.h"
-#ifndef NEWVERSION
-#include "AliITSDetType.h"
-#endif
-#ifdef NEWVERSION
#include "AliITSDetTypeSim.h"
-#include "AliITSDetTypeRec.h"
-#endif
+
class TString;
class TTree;
-class TFile;
+class AliITSpListItem;
class AliITSsimulation;
-class AliITSClusterFinder;
-class AliITSclusterV2;
-class AliITSLoader;
class AliITSsegmentation;
class AliITSresponse;
class AliITShit;
class AliITSgeom;
-class AliITSpListItem;
class AliITSdigit;
-class AliITSRecPoint;
-class AliITSRawCluster;
class AliITSmodule;
-class AliVertexer;
class AliDigitizer;
class AliRunDigitizer;
-class AliRawReader;
-const Int_t kNTYPES=3;
class AliITS : public AliDetector {
AliITS(const char *name, const char *title); // standard Creator
virtual ~AliITS(); // destructor
AliITS(const AliITS &source); // copy constructor. Not to be used!
- AliITS& operator=(AliITS &source); // = operator. Not to be used!
+ AliITS& operator=(const AliITS &source); // = operator. Not to be used!
virtual Int_t IsVersion() const {return 1;}
virtual Int_t DistancetoPrimitive(Int_t , Int_t ) {return 999;}
// get geometry version - detailed (major) or coarse (minor)
virtual Int_t GetMajorVersion() const {return -1;}
virtual Int_t GetMinorVersion() const {return -1;}
- virtual void GetGeometryVersion(Int_t &a,Int_t &b)
+ virtual void GetGeometryVersion(Int_t &a,Int_t &b) const
{a = GetMajorVersion();b=GetMinorVersion();return;}
virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
virtual Bool_t GetEUCLID()const {return fEuclidOut;}
//-------------------- Geometry Transformations --------------------
-#ifndef NEWVERSION
- // ITS geometry functions
- AliITSgeom *GetITSgeom() const {return fITSgeom;}
- // Sets ITS geometry ! be very careful using this function.
- void SetITSgeom(AliITSgeom *geom) {fITSgeom = geom;}
- // return pointer to the array of modules
- TObjArray *GetModules() const {return fITSmodules;}
- // return pointer to a particular module
- AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *)
- (fITSmodules->At(index));}
-#endif
-#ifdef NEWVERSION
- // ITS geometry functions
- AliITSgeom* GetITSgeom()const{if(fDetTypeSim!=0)
- return fDetTypeSim->GetITSgeom();else if(fDetTypeRec!=0)
- return fDetTypeRec->GetITSgeom();else return 0;}
+
// ITS geometry functions From Simulation
- AliITSgeom* GetITSgeomSim()const{if(fDetTypeSim!=0)
- return fDetTypeSim->GetITSgeom();else return 0;}
- // ITS geometry functions From Reconstruction
- AliITSgeom* GetITSgeomRec()const{if(fDetTypeRec!=0)
- return fDetTypeRec->GetITSgeom();else return 0;}
- // Sets ITS geometry ! be very careful using this function.
- void SetITSgeom(AliITSgeom *geom) {if(fDetTypeSim!=0)
- fDetTypeSim->SetITSgeom(geom);if(fDetTypeRec!=0)
- fDetTypeRec->SetITSgeom(geom);}
- // Sets ITS geometry For Simulation ! be very careful using this function.
- void SetITSgeomSim(AliITSgeom *geom) {if(fDetTypeSim!=0)
- fDetTypeSim->SetITSgeom(geom);}
- // Sets ITS geometry For Reconstruction! be very careful using this fun.
- void SetITSgeomRec(AliITSgeom *geom) {if(fDetTypeRec!=0)
- fDetTypeRec->SetITSgeom(geom);}
+ AliITSgeom* GetITSgeom() const {return fDetTypeSim->GetITSgeom();}
+ void SetITSgeom(AliITSgeom *geom) {fDetTypeSim->SetITSgeom(geom);}
+ virtual void WriteGeometry();
// return pointer to the array of modules
- TObjArray *GetModules() const {return fDetTypeSim->GetModules();}
- // return pointer to a particular module
- AliITSmodule *GetModule(Int_t index){return fDetTypeSim->GetModule(index);}
-#endif
+ TObjArray *GetModules(){return fITSmodules;}
+ AliITSmodule *GetModule(Int_t index){
+ return (AliITSmodule*)(fITSmodules->At(index));}
+
+ virtual void SetDetTypeSim(AliITSDetTypeSim* dts) {fDetTypeSim=dts;}
+ AliITSDetTypeSim* GetDetTypeSim() const {return fDetTypeSim;}
//================ Necessary general Classes =======================
virtual void Init();
virtual AliLoader* MakeLoader(const char* topfoldername);
virtual void SetDefaults();
virtual void SetDefaultSimulation();
- virtual void SetDefaultClusterFinders();
- virtual void SetDefaultClusterFindersV2();
virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranchS(const char* fl);
+ virtual void MakeBranchD(const char* file);
+ virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
virtual void SetTreeAddress();
-#ifndef NEWVERSION
- // For a given branch from the treeH sets the TClonesArray address.
- virtual void SetHitsAddressBranch(TBranch *b) {b->SetAddress(&fHits);}
- // Return pointer to DetType #id
- AliITSDetType *DetType(Int_t id){
- return ((AliITSDetType*) fDetTypes->At(id));};
- //Int_t NDetTypes() {return fNDetTypes;}
-#endif
- //---------- Configuration Methods (per detector type) -------------
+ //---------- Configuration Methods (per detector type) -------------
// Determines which ITS subdetectors will be processed. Effects
// digitization, and Reconstruction only.
void SetDetectors(Option_t *opt="All"){fOpt = opt;}
// Returns the list of ITS subdetectors that will be processed.
Option_t* GetDetectors(){return fOpt;}
-#ifndef NEWVERSION
- // Set response
- virtual void SetResponseModel(Int_t id, AliITSresponse *response){
- ((AliITSDetType*) fDetTypes->At(id))->ResponseModel(response);};
- // Set segmentation
- virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
- ((AliITSDetType*) fDetTypes->At(id))->SegmentationModel(seg);};
- // Set simulation - temporary
- virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim){
- ((AliITSDetType*) fDetTypes->At(id))->SimulationModel(sim);};
- // Set simulation - temporary
- virtual AliITSsimulation* GetSimulationModel(Int_t id){
- return ((AliITSDetType*)(fDetTypes->At(id)))->GetSimulationModel();}
- // Set reconstruction
- virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec){
- ((AliITSDetType*) fDetTypes->At(id))->ReconstructionModel(rec);};
- // Set class names for digit and rec point
- virtual void SetClasses(Int_t id, const char *digit, const char *cluster){
- ((AliITSDetType*) fDetTypes->At(id))->ClassNames(digit,cluster);};
-#endif
-#ifdef NEWVERSION
+
// Set response
virtual void SetResponseModel(Int_t module, AliITSresponse *response){
- fDetTypeSim->SetResponseModel(module,response);};
+ fDetTypeSim->SetResponseModel(module,response);}
// Set segmentation for Simulation
- virtual void SetSegmentationModelSim(Int_t id, AliITSsegmentation *seg){
- fDetTypeSim->SetSegmentationModel(id,seg);};
- // Set segmentation for Reconstruction
- virtual void SetSegmentationModelRec(Int_t id, AliITSsegmentation *seg){
- fDetTypeRec->SetSegmentationModel(id,seg);};
- // Set segmentation
virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
- SetSegmentationModelSim(id,seg);SetSegmentationModelRec(id,seg);};
+ fDetTypeSim->SetSegmentationModel(id,seg);}
// Set simulation
virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim){
- fDetTypesSim->SetSimulationModel(sim);};
+ fDetTypeSim->SetSimulationModel(id,sim);}
// Set simulation
virtual AliITSsimulation* GetSimulationModel(Int_t id){
- return fDetTypesSim->GetSimulationModel(id);}
- // Set Calibration
- virtual void SetCalibrationModel(Int_t module, AliITSCalibration *cal){
- fDetTypeRec->SetCalibrationModel(module,cal);};
- // Set reconstruction
- virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec){
- fDetTypesRec->SetReconstructionModel(id,rec);};
- // Set Class name for Hits
- virtual void SetHitClassName(){
- fDetTypeSim->SetHitClassName(this->GetName());}
- // Set Class name for SDigits
- virtual void SetSDigitClassName(const char *sdigit){
- fDetTypeSim->SetSDigitClassName(sdigit);}
- // Set Class name for Digits for simulation
- virtual void SetDigitClassNameSim(const char *digit){
- fDetTypeSim->SetDigitClassName(digit);}///////// Array of names
- // Set Class name for Digits for Reconstruction
- virtual void SetDigitClassNameRec(const char *digit){
- fDetTypeRec->SetDigitClassName(digit);}///////// Array of names
- virtual void SetClusterClassName(const char *digit){
- fDetTypeRec->SetClusterClassName(digit);}///////// Array of names
- virtual void SetRecPointClassName(const char *digit){
- fDetTypeRec->SetRecPointClassName(digit);}///////// Array of names
- // Set class names for digit and rec point
- virtual void SetClasses(Int_t id, const char *digit, const char *cluster){
- SetDigitClassNameSim(digit);SetDigitClassNameRec(digit);
- SetRecPointClassName(cluster);};
-#endif
-
+ return fDetTypeSim->GetSimulationModel(id);}
//=================== Hits =========================================
virtual void StepManager() {} // See Step Manager for specific geometry.
//------------ sort hits by module for Digitisation ----------------
- virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
- Option_t *opt, const char *filename);
-#ifndef NEWVERSION
- virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
+ virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules, Option_t *opt, const char *filename);
+
virtual void InitModules(Int_t size,Int_t &nmodules);
virtual void FillModules(TTree *treeH, Int_t mask = 0);
- virtual void ClearModules(){if(fITSmodules) fITSmodules->Delete();};
-#endif
-#ifdef NEWVERSION
- virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits){
- if(fDetTypeSim!=0)fDetTypeSim->AddHit(track,vol,hits);};
- virtual void AddHit(AliITShit &hit){
- if(fDetTypeSim!=0)fDetTypeSim->AddHit(hit);};
- virtual void InitModules(Int_t size,Int_t &nmodules){if(fDetTypeSim!=0)
- fDetTypeSim->InitModules(size,nmodules);};
- virtual void FillModules(TTree *treeH, Int_t mask = 0){if(fDetTypeSim!=0)
- fDetTypeSim->FillModules(treeH,mask);};
- virtual void ClearModules(){if(fDetTypeSim!=0)
- fDetTypeSim->ClearModules();};
-#endif
+ virtual void ClearModules(){if(fITSmodules) fITSmodules->Delete();}
+ virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
+
+ TClonesArray* GetSDigits() const { return fDetTypeSim->GetSDigits();}
- //===================== Digitisation ===============================
-#ifndef NEWVERSION
- void MakeBranchS(const char *file);
- void SetTreeAddressS(TTree *treeS);
- TClonesArray * GetSDigits() { return fSDigits; }
- void MakeBranchInTreeD(TTree *treeD,const char *file=0);
- void MakeBranchD(const char *file){
- MakeBranchInTreeD(GetLoader()->TreeD(),file);}
- void SetTreeAddressD(TTree *treeD);
-#endif
-#ifndef NEWVERSION
- void Hits2SDigits(); // Turn hits into SDigits
- void Hits2PreDigits(){ // Turn hits into SDigits
- HitsToPreDigits(fLoader->GetRunLoader()->GetEventNumber(),
- 0,-1," ",fOpt," ");};
AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
- void SDigits2Digits(){SDigitsToDigits("All");} // Turn SDigits to Digits
- void SDigitsToDigits(Option_t *opt="All"); // Turn SDigits to Digits
- void Hits2Digits(); // Turn hits straight into Digits.
- //------------------ Internal functions ----------------------------
- // Standard Hits To SDigits function
+ virtual void SDigitsToDigits(Option_t *opt="All");
+ virtual void SDigits2Digits(){SDigitsToDigits("All");}
+ virtual void Hits2Digits();
+ virtual void Hits2SDigits();
+ virtual void Hits2PreDigits();
+ virtual void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
+ Option_t *option,Option_t *opt,
+ const char *filename);
+ virtual void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
+ Option_t *option,Option_t *opt,
+ const char *filename);
void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
Option_t *add, Option_t *det, const char *filename)
- {HitsToPreDigits(evNumber,bgrev,size,add,det,filename);};
- // Standard Hits To SDigits function
- void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
- Option_t *add, Option_t *det, const char *filename);
- // Standard Hits To Digits function
- void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
- Option_t *add, Option_t *det, const char *filename);
-#endif
-#ifdef NEWVERSION
- // Turn hits into SDigits
- void Hits2SDigits(){if(fDetTypeSim)fDetTypeSim->Hits2SDigits();};
- AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
- // Turn SDigits to Digits
- void SDigits2Digits(){if(fDetTypeSim)fDetTypeSim->SDigits2Digits();}
- // Turn hits straight into Digits.
- void Hits2Digits(){if(fDetTypeSim)fDetTypeSim->Hits2Digits();};
-#endif
- // Resets the Summable digits.
-#ifndef NEWVERSION
- void ResetSDigits(){if(fSDigits) fSDigits->Clear();fNSDigits = 0;};
- void ResetDigits(); // depending on how the
- void ResetDigits(Int_t branch); // tree will be filled only
- void AddSumDigit(AliITSpListItem &sdig);
- void AddRealDigit(Int_t branch, Int_t *digits);
- void AddSimDigit(Int_t branch, AliITSdigit *d);
- void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
+ {HitsToPreDigits(evNumber,bgrev,size,add,det,filename);};
+
+ virtual void ResetDigits();
+ virtual void ResetDigits(Int_t branch);
+ virtual void AddSumDigit(AliITSpListItem &sdig);
+ virtual void AddRealDigit(Int_t branch, Int_t *digits);
+
+ virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
+ virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
Int_t* tracks,Int_t *hits,Float_t* trkcharges);
-#endif
- // Return pointers to digits
-#ifndef NEWVERSION
- TObjArray *Dtype() {return fDtype;}
- Int_t *Ndtype() {return fNdtype;}
- TClonesArray *DigitsAddress(Int_t id)
- {return ((TClonesArray *) (*fDtype)[id]);}
-#endif
-#ifdef NEWVERSION
- TObjArray* GetDigitsSim(){if(fDetTypeSim!=0)
- return fDetTypeSim->GetDigits();else return 0;}
- TObjArray* GetDigitsRec(){if(fDetTypeRec!=0)
- return fDetTypeRec->GetDigits();else return 0;}
- TObjArray *Dtype() {if(fDetTypeSim!=0) return GetDigitsSim();
- else if(fDetTypeRec!=0) return GetDigitsRec(); else return 0;}
- Int_t* GetNDigitArraySim(){if(fDetTypeSim!=0)
- fDetTypeSim->GetNDigitArray();}
- Int_t* GetNDigitArrayRec(){if(fDetTypeRec!=0)
- fDetTypeRec->GetNDigitArray();}
- Int_t *Ndtype() {if(fDetTypeSim!=0) return GetNDigitArraySim();
- else if(fDetTypeRec!=0) return GetNDigitArrayRec(); else return 0;}
- TClonesArray *DigitsAddressSim(Int_t id){if(fDetTypeSim!=0)
- return fDetTypeSim->GetDigitsAddress(id);else return 0;}
- TClonesArray *DigitsAddressRec(Int_t id){if(fDetTypeRec!=0)
- return fDetTypeRec->GetDigitsAddress(id);else return 0;}
- TClonesArray *DigitsAddress(Int_t id){if(fDetTypeSim!=0)
- return DigitsAddressSim(id);else if(fDetTypeRec!=0) DigitsAddressRec(id);
- else return 0;}
-#endif
- void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
-#ifndef NEWVERSION
-
- //===================== Raw Data IO ================================
- // Write digits into raw data format
- virtual void Digits2Raw();
-
- //==================== Clusterization ==============================
- // create separate tree for clusters - declustering refining
- void MakeTreeC(Option_t *option="C");
- void GetTreeC(Int_t event);
- void AddCluster(Int_t branch, AliITSRawCluster *c);
- // one of the methods in
- void ResetClusters(){for(Int_t i=0;i<kNTYPES;i++ ) ResetClusters(i);};
- void ResetClusters(Int_t branch); // the pair will be kept
- void MakeBranchC();
- // Return pointers to clusters
- TObjArray *Ctype() {return fCtype;}
- Int_t *Nctype() {return fNctype;}
- TClonesArray *ClustersAddress(Int_t id)
- {return ((TClonesArray *) (*fCtype)[id]);}
-#endif
-#ifdef NEWVERSION
+ TObjArray* GetDigits() const {return fDetTypeSim->GetDigits();}
+ Int_t* GetNDigitArray() const {return fDetTypeSim->GetNDigitArray();}
+ TClonesArray *DigitsAddress(Int_t id) { return fDetTypeSim->DigitsAddress(id);}
+ //Fast simulation
+ virtual void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
+ Option_t *add, Option_t *det, const char *filename);
+ virtual Int_t Hits2Clusters(TTree *in, TTree *out);
+ virtual void RecPoints2Clusters
+ (const TClonesArray *points, Int_t idx, TClonesArray *clusters);
+ virtual void CheckLabels(Int_t lab[3]) const;
//===================== Raw Data IO ================================
// Write digits into raw data format
- virtual void Digits2Raw(){if(fDetTypeSim)fDetTypeSim->Digits2Raw();};
+ virtual void Digits2Raw(); ;
- //==================== Clusterization ==============================
- // create separate tree for clusters - declustering refining
- void MakeTreeC(Option_t *option="C"){fDetTypeRec->MakeTreeC();};
- void GetTreeC(Int_t event){fDetTypeRec->GetTreeC(event);};
- void AddCluster(Int_t branch, AliITSRawCluster *c){
- fDetTypeRec->AddCluster(branch,c);};
- // one of the methods in
- void ResetClusters(){for(Int_t i=0;i<kNTYPES;i++ ) ResetClusters(i);};
- void ResetClusters(Int_t branch){fDetTypeRec->ResetCluster(i);};
- void MakeBranchC(){fDetTypeRec->MakeBranchC();};
- // Return pointers to clusters
- TObjArray *Ctype() {if(fDetTypeRec!=0)
- return fDetTypeRec->GetClusterArray(); else return 0;}
- Int_t *Nctype() {if(fDetTypeRec!=0)
- return fDetTypeRec->GetNClusters(); else return 0;;}
- TClonesArray *ClustersAddress(Int_t id){if(fDetTypeRec!=0)
- return fDetTypeRec->GetClusterAddress(id]); else return 0;}
-#endif
-
- //=================== Reconstruction ===============================
-#ifndef NEWVERSION
- void MakeBranchR(const char *file, Option_t *opt=" ");
- void SetTreeAddressR(TTree *treeR);
- void AddRecPoint(const AliITSRecPoint &p);
- void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
- // Return pointer to rec points
- TClonesArray *RecPoints() {return fRecPoints;}
-
- void AddClusterV2(const AliITSclusterV2 &cl);
- void ResetClustersV2(){if(fClustersV2) fClustersV2->Clear();fNClustersV2=0;}
- Int_t GetNClustersV2()const {return fNClustersV2;}
-// Return pointer to clustersV2
-TClonesArray *ClustersV2() {return fClustersV2;}
-#endif
-#ifdef NEWVERSION
- void MakeBranchR(const char *file, Option_t *opt=" ");
- void SetTreeAddressR(TTree *treeR){fDetTypeRec->SetTreeAddressR(treeR);};
- void AddRecPoint(const AliITSRecPoint &p){fDetTypeRec->AddRecPoint(p);};
- void ResetRecPoints(){if(fDetTypeRec) fDetTypeRec->ResetRecPoints();};
- // Return pointer to rec points
- TClonesArray* RecPoints() {if(fDetTypeRec!=0)
- return fDetTypeRec->GetRecPoints();else return 0;}
-#endif
- void MakeBranchRF(const char *file){MakeBranchR(file,"Fast");}
- void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
- Option_t *add, Option_t *det, const char *filename);
- void Digits2Reco(){
- DigitsToRecPoints(fLoader->GetRunLoader()->GetEventNumber(),0,fOpt);};
- void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
-void DigitsToRecPoints(AliRawReader* rawReader);
protected:
+ static const Int_t fgkNTYPES=3; //number of detector types
//================== Data Members ==================================
-#ifdef NEWVERSION
- AliITSDetTypeSim *fDetTypeSim; //
- AliITSDetTypeRec *fDetTypeRec; //
-#endif
-#ifndef NEWVERSION
- AliITSgeom *fITSgeom; // Pointer to ITS geometry
-#endif
+ AliITSDetTypeSim *fDetTypeSim; //detector type for simulation
Bool_t fEuclidOut; // Flag to write geometry in euclid format
-#ifndef NEWVERSION
- TObjArray *fITSmodules; //! Pointer to ITS modules
-#endif
Option_t *fOpt; //! Detector option ="All" unless changed.
-
Int_t fIdN; // the number of layers
Int_t *fIdSens; //[fIdN] layer identifier
TString *fIdName; //[fIdN] layer identifier
-#ifndef NEWVERSION
- Int_t fNDetTypes; // Number of detector types
- TObjArray *fDetTypes; // List of detector types
-
- TClonesArray *fSDigits; //! List of Summable digits.
- Int_t fNSDigits; // Number of Summable Digits.
-
- TObjArray *fDtype; //! List of digits
- Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det.
-
- TObjArray *fCtype; //! List of clusters
- Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det.
-
- TClonesArray *fRecPoints; //! List of reconstructed points
- Int_t fNRecPoints; // Number of rec points
-
- TClonesArray *fClustersV2; //!List of reconstructed clusters v2
- Int_t fNClustersV2; //Number of clusters v2
-
-#endif
- TString fSelectedVertexer; // Vertexer selected in CreateVertexer
-#ifndef NEWVERSION
- ClassDef(AliITS,5) // Base class for ITS
-#endif
-#ifdef NEWVERSION
+ TObjArray *fITSmodules; //! Pointer to ITS modules
ClassDef(AliITS,5) // Base class for ITS
-#endif
+
};
#endif
--- /dev/null
+///////////////////////////////////////////////////////
+// Macro to create the galice.root file for ///
+// beam test analysis (using AliITSBeamTestDigitizer //
+// class). Before using AliITSBeamTestDigitizer it //
+// is necessary to run this macro to create the //
+// galice.root file. //
+// Options: Nov04 for integrated //
+// ITS beam test November 2004 //
+// //
+// Aug04 for SDD beam test August 2004 //
+// E. Crescio: crescio@to.infn.it //
+///////////////////////////////////////////////////////
+
+void AliITSBeamTest(Char_t* opt="Nov04"){
+
+ TString choice(opt);
+ Bool_t aug04 = choice.Contains("Aug04");
+ Bool_t nov04 = choice.Contains("Nov04");
+
+ AliRunLoader* rl = AliRunLoader::Open("galice.root",
+ AliConfig::GetDefaultEventFolderName(),"recreate");
+
+ gAlice->SetRunLoader(rl);
+ rl->SetEventFolderName();
+
+ AliITS* bt;
+ if(nov04){
+ if(gGeoManager) delete gGeoManager;
+ gGeoManager = new TGeoManager("ITSGeometry","ITS Simulation Geometry Manager");
+ TGeoMaterial *vacmat = new TGeoMaterial("Vacuum",0,0,0);
+ TGeoMedium *vacmed = new TGeoMedium("Vacuum_med",1,vacmat);
+ TGeoVolume *aLICE = gGeoManager->MakeBox("ALICE",vacmed,100.,100.,200.);
+ gGeoManager->SetTopVolume(aLICE);
+ bt = new AliITSvBeamTestITS04("ITS","ITS beam test");
+ bt->CreateGeometry();
+ bt->Init();
+ }
+ if(aug04){
+ bt = new AliITSvSDD03("ITS",2004);
+ gSystem->Load("libgeant321");
+ new TGeant3("C++ Interface to Geant3");
+ if(strcmp(gMC->GetName(),"TGeant3")) {
+ Fatal("Init","TGeant3 should be instantiated in advance");
+ return;
+ }
+ bt->CreateMaterials();
+ bt->CreateGeometry();
+ bt->Init();
+ }
+ gAlice->AddModule(bt);
+ bt->SetDefaults();
+ rl->AddLoader(bt);
+ // rl->MakeTree("E");
+ //rl->WriteHeader("OVERWRITE");
+ rl->WriteRunLoader("OVERWRITE");
+ rl->WriteAliRun("OVERWRITE");
+
+}
//
fReader=0;
fTreeD=0;
- fBt=0;
fITSHeader=0;
+ fITSgeom=0;
}
//_____________________________________________________________
fReader=0;
fTreeD=0;
- fBt=0;
fITSHeader=0;
-
+ fITSgeom = 0;
}
//______________________________________________________________________
fReader=bt.fReader;
fTreeD=bt.fTreeD;
- fBt=bt.fBt;
fITSHeader=bt.fITSHeader;
+ fITSgeom = bt.fITSgeom;
}
//______________________________________________________________________
AliITSBeamTestDig& AliITSBeamTestDig::operator=(const AliITSBeamTestDig &source){
#include "TTask.h"
-class AliITS;
+
class AliRawReader;
class TTree;
class AliITSEventHeader;
+class AliITSgeom;
class AliITSBeamTestDig: public TTask {
void SetRawReader(AliRawReader* rd) {fReader=rd;}
void SetTree(TTree* treedig) {fTreeD=treedig;}
void SetITSEventHeader(AliITSEventHeader* header){fITSHeader = header;}
-
- void SetBeamTest(AliITS* bt) {fBt=bt;}
+ void SetITSgeom(AliITSgeom* geom) {fITSgeom=geom;}
protected:
AliITSEventHeader* fITSHeader; // its event header
AliRawReader* fReader; // !reader ;
TTree* fTreeD; // tree of digits
-
- AliITS* fBt; // !beam test object
+ AliITSgeom* fITSgeom; // !ITS geometry
+
- ClassDef(AliITSBeamTestDig,3) // its beam test digitization
+ ClassDef(AliITSBeamTestDig,4) // its beam test digitization
};
// //
// //
////////////////////////////////////////////////////
-#include "AliITS.h"
#include "AliITSdigitSDD.h"
#include "AliRawReader.h"
#include "AliVMERawStream.h"
TBranch* branch = fTreeD->GetBranch("ITSDigitsSDD");
Int_t maxn=0;
- AliITSgeom* geom = fBt->GetITSgeom();
+
+ if(!fITSgeom){
+ Error("Exec","fITSgeom is null!");
+ return;
+ }
+
Int_t nsdd=0;
Int_t nspd=0;
Int_t nssd=0;
- for(Int_t nlay=1;nlay<=geom->GetNlayers();nlay++){
- for(Int_t nlad=1;nlad<=geom->GetNladders(nlay);nlad++){
- for(Int_t ndet=1;ndet<=geom->GetNdetectors(nlay);ndet++){
- Int_t index=geom->GetModuleIndex(nlay,nlad,ndet);
- if(geom->GetModuleTypeName(index)=="kSPD") nspd++;
- if(geom->GetModuleTypeName(index)=="kSDD") nsdd++;
- if(geom->GetModuleTypeName(index)=="kSSD") nssd++;
+ for(Int_t nlay=1;nlay<=fITSgeom->GetNlayers();nlay++){
+ for(Int_t nlad=1;nlad<=fITSgeom->GetNladders(nlay);nlad++){
+ for(Int_t ndet=1;ndet<=fITSgeom->GetNdetectors(nlay);ndet++){
+ Int_t index=fITSgeom->GetModuleIndex(nlay,nlad,ndet);
+ if(fITSgeom->GetModuleTypeName(index)=="kSPD") nspd++;
+ if(fITSgeom->GetModuleTypeName(index)=="kSDD") nsdd++;
+ if(fITSgeom->GetModuleTypeName(index)=="kSSD") nssd++;
}
}
}
// //
////////////////////////////////////////////////////
-#include "AliITS.h"
#include "AliITSdigitSPD.h"
#include "AliRawReader.h"
#include "AliRawReader.h"
//Reads raw data for SPD, fill SPD digits tree
+ if(!fITSgeom){
+ Error("Exec","fITSgeom is null!");
+ return;
+ }
TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
- AliITSgeom* geom = fBt->GetITSgeom();
Int_t nsdd=0;
Int_t nspd=0;
Int_t nssd=0;
- for(Int_t nlay=1;nlay<=geom->GetNlayers();nlay++){
- for(Int_t nlad=1;nlad<=geom->GetNladders(nlay);nlad++){
- for(Int_t ndet=1;ndet<=geom->GetNdetectors(nlay);ndet++){
- Int_t index=geom->GetModuleIndex(nlay,nlad,ndet);
- if(geom->GetModuleTypeName(index)=="kSPD") nspd++;
- if(geom->GetModuleTypeName(index)=="kSDD") nsdd++;
- if(geom->GetModuleTypeName(index)=="kSSD") nssd++;
+ for(Int_t nlay=1;nlay<=fITSgeom->GetNlayers();nlay++){
+ for(Int_t nlad=1;nlad<=fITSgeom->GetNladders(nlay);nlad++){
+ for(Int_t ndet=1;ndet<=fITSgeom->GetNdetectors(nlay);ndet++){
+ Int_t index=fITSgeom->GetModuleIndex(nlay,nlad,ndet);
+ if(fITSgeom->GetModuleTypeName(index)=="kSPD") nspd++;
+ if(fITSgeom->GetModuleTypeName(index)=="kSDD") nsdd++;
+ if(fITSgeom->GetModuleTypeName(index)=="kSSD") nssd++;
}
}
}
// Date: October 2004 //
////////////////////////////////////////
-#include "AliITS.h"
#include "AliITSgeom.h"
#include "AliITSdigitSSD.h"
#include "AliRawReader.h"
//returns 2 if calibration (injector) data, returns 3 if calibration (test pul //se) event
TBranch* branch = fTreeD->GetBranch("ITSDigitsSSD");
- AliITSgeom* geom = fBt->GetITSgeom();
+ if(!fITSgeom){
+ Error("Exec","fITSgeom is null!");
+ return;
+ }
+
Int_t nsdd=0;
Int_t nspd=0;
Int_t nssd=0;
- for(Int_t nlay=1;nlay<=geom->GetNlayers();nlay++){
- for(Int_t nlad=1;nlad<=geom->GetNladders(nlay);nlad++){
- for(Int_t ndet=1;ndet<=geom->GetNdetectors(nlay);ndet++){
- Int_t index=geom->GetModuleIndex(nlay,nlad,ndet);
- if(geom->GetModuleTypeName(index)=="kSPD") nspd++;
- if(geom->GetModuleTypeName(index)=="kSDD") nsdd++;
- if(geom->GetModuleTypeName(index)=="kSSD") nssd++;
+ for(Int_t nlay=1;nlay<=fITSgeom->GetNlayers();nlay++){
+ for(Int_t nlad=1;nlad<=fITSgeom->GetNladders(nlay);nlad++){
+ for(Int_t ndet=1;ndet<=fITSgeom->GetNdetectors(nlay);ndet++){
+ Int_t index=fITSgeom->GetModuleIndex(nlay,nlad,ndet);
+ if(fITSgeom->GetModuleTypeName(index)=="kSPD") nspd++;
+ if(fITSgeom->GetModuleTypeName(index)=="kSDD") nsdd++;
+ if(fITSgeom->GetModuleTypeName(index)=="kSSD") nssd++;
}
}
}
// ITS beam test conversion from rawdata //
// to digits. It executes the digitization for //
// SPD, SDD and SSD. //
+// //
+// //
// Origin: E. Crescio crescio@to.infn.it //
// J. Conrad Jan.Conrad@cern.ch //
////////////////////////////////////////////////////
#include "AliRunLoader.h"
#include "AliITSEventHeader.h"
#include "AliITSLoader.h"
-#include "AliITSvBeamTestITS04.h"
-#include "AliITSvSDD03.h"
#include "AliITSBeamTestDigSDD.h"
#include "AliITSBeamTestDigSPD.h"
#include "AliITSBeamTestDigSSD.h"
#include "AliITSBeamTestDigitizer.h"
#include "AliRawReaderDate.h"
#include "AliRawReaderRoot.h"
-#include "TGeoManager.h"
-#include "TGeoMaterial.h"
-#include "TGeoMedium.h"
-#include "TGeoVolume.h"
-#include <TVirtualMC.h>
-//#include <TGeant3.h>
const TString AliITSBeamTestDigitizer::fgkDefaultDigitsFileName="ITS.Digits.root";
fRunNumber=-1;
SetFlagInit();
SetOptDate();
- fBt=0;
fPeriod=kNov04;
}
//_____________________________________________________________
- AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const Text_t* name, const Text_t* title, Char_t* opt):TTask(name,title)
+ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const Text_t* name, const Text_t* title, Char_t* opt,const char* filename):TTask(name,title)
{
//
// Standard constructor
//
fRunLoader=0;
fLoader=0;
- fBt=0;
fEvIn=0;
fEvFin=0;
fDATEEvType=7;
Bool_t nov04 = choice.Contains("Nov04");
if(aug04) fPeriod=kAug04;
if(nov04) fPeriod=kNov04;
- Init();
+ Init(filename);
}
//_____________________________________________________________
- AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const Text_t* name, const Text_t* title, Int_t run, Char_t* opt):TTask(name,title)
+ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const Text_t* name, const Text_t* title, Int_t run, Char_t* opt,const char* filename):TTask(name,title)
{
//
//
fRunLoader=0;
fLoader=0;
- fBt=0;
fEvIn=0;
fEvFin=0;
fDATEEvType=7;
if(aug04) fPeriod=kAug04;
if(nov04) fPeriod=kNov04;
- Init();
+ Init(filename);
}
//___________________________________________________________
-void AliITSBeamTestDigitizer::Init(){
+void AliITSBeamTestDigitizer::Init(const char* filename){
//
//Initialization of run loader and its loader
//creation of galice.root
//
- fRunLoader = AliRunLoader::Open("galice.root",
- AliConfig::GetDefaultEventFolderName(),"recreate");
-
- gAlice->SetRunLoader(fRunLoader);
- fRunLoader->SetEventFolderName();
- if(GetBeamTestPeriod()==kNov04){
- if(gGeoManager) delete gGeoManager;
- gGeoManager = new TGeoManager("ITSGeometry","ITS Simulation Geometry Manager");
- TGeoMaterial *vacmat = new TGeoMaterial("Vacuum",0,0,0);
- TGeoMedium *vacmed = new TGeoMedium("Vacuum_med",1,vacmat);
- TGeoVolume *aLICE = gGeoManager->MakeBox("ALICE",vacmed,100.,100.,200.);
- gGeoManager->SetTopVolume(aLICE);
- fBt = new AliITSvBeamTestITS04("ITS","ITS beam test");
- fBt->CreateGeometry();
- fBt->Init();
-
- }
- if(GetBeamTestPeriod()==kAug04){
- fBt = new AliITSvSDD03("ITS",2004);
- gSystem->Load("libgeant321");
- // new TGeant3("C++ Interface to Geant3");
- if(strcmp(gMC->GetName(),"TGeant3")) {
- Fatal("Init","TGeant3 should be instantiated in advance");
- return;
- }
- fBt->CreateMaterials();
- fBt->CreateGeometry();
- fBt->Init();
- }
- gAlice->AddModule(fBt);
- fBt->SetDefaults();
- fRunLoader->AddLoader(fBt);
- fLoader = (AliITSLoader*)fRunLoader->GetLoader("ITSLoader");
- fRunLoader->MakeTree("E");
- fRunLoader->WriteHeader("OVERWRITE");
- fRunLoader->WriteRunLoader("OVERWRITE");
- fRunLoader->WriteAliRun("OVERWRITE");
-
- fDigitsFileName=fgkDefaultDigitsFileName;
- this->Add(new AliITSBeamTestDigSPD("DigSPD","SPD Digitization"));
- this->Add(new AliITSBeamTestDigSDD("DigSDD","SDD Digitization"));
- this->Add(new AliITSBeamTestDigSSD("DigSSD","SSD Digitization"));
-
- SetFlagInit(kTRUE);
-}
-
-//_____________________________________________________________
- AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const char* filename)
-{
- //
- // Constructor for reading (reads galice.root)
- //
- fRunLoader = AliRunLoader::Open(filename);
+ fRunLoader = AliRunLoader::Open(filename,AliConfig::GetDefaultEventFolderName(),"update");
if (fRunLoader == 0x0)
{
Error("AliITSBeamTestDigitizer","Can not load the session",filename);
Error("AliITSBeamTestDigitizer","gAlice not found on file. Aborting.");
return;
}
-
+ fRunLoader->MakeTree("E");
fLoader = (AliITSLoader*)fRunLoader->GetLoader("ITSLoader");
-
- //fBt = (AliITSBeamTest*)gAlice->GetDetector("ITS");
- fBt->SetDefaults();
fDigitsFileName=fgkDefaultDigitsFileName;
+ this->Add(new AliITSBeamTestDigSPD("DigSPD","SPD Digitization"));
+ this->Add(new AliITSBeamTestDigSDD("DigSDD","SDD Digitization"));
+ this->Add(new AliITSBeamTestDigSSD("DigSSD","SSD Digitization"));
- fEvIn=0;
- fEvFin=0;
- SetOptDate();
-
+ SetFlagInit(kTRUE);
}
+
//______________________________________________________________________
AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const AliITSBeamTestDigitizer &bt):TTask(bt){
// Copy constructor.
AliITSBeamTestDigitizer::~AliITSBeamTestDigitizer(){
//Destructor
- if(fBt) delete fBt;
+ // if(fBt) delete fBt;
if(fLoader) delete fLoader;
if(fHeader) delete fHeader;
}
else rd = new AliRawReaderRoot(fRawdataFileName,fEvIn);
AliHeader* header = fRunLoader->GetHeader();
-
Int_t iev=fEvIn-1;
digSDD->SetTree(treeD);
digSPD->SetTree(treeD);
- digSSD->SetBeamTest(fBt);
- digSDD->SetBeamTest(fBt);
- digSPD->SetBeamTest(fBt);
+ AliITSgeom* geom = fLoader->GetITSgeom();
+
+ digSSD->SetITSgeom(geom);
+ digSDD->SetITSgeom(geom);
+ digSPD->SetITSgeom(geom);
digSSD->SetITSEventHeader(itsh);
digSDD->SetITSEventHeader(itsh);
class AliRawReaderDate;
class AliRunLoader;
class AliITSLoader;
-class AliITS;
class AliITSEventHeader;
class AliRawDataHeader;
AliITSBeamTestDigitizer();
AliITSBeamTestDigitizer(const Text_t* name,const Text_t* title,
- Char_t* opt="Nov04");
+ Char_t* opt="Nov04",const char* filename="galice.root");
AliITSBeamTestDigitizer(const Text_t* name,const Text_t* title,
- Int_t run,Char_t* opt="Nov04");
- AliITSBeamTestDigitizer(const char* filename);
+ Int_t run,Char_t* opt="Nov04",const char* filename="galice.root");
AliITSBeamTestDigitizer(const AliITSBeamTestDigitizer& bt);
AliITSBeamTestDigitizer& operator=(const AliITSBeamTestDigitizer &source);
void SetRunNumber(Int_t run) {fRunNumber=run;}
void SetOptDate(Bool_t opt=kFALSE) {fOptDate=opt;}
- void SetBeamTestGeometry(AliITS* bt){fBt=bt;}
-
void SetActive(const TString& subdet,Bool_t value);
void ExecDigitization();
- void Init();
+ void Init(const char* filename);
Int_t GetRunNumber() const {return fRunNumber;}
Bool_t GetFlagInit() const {return fFlagInit;}
Bool_t GetOptDate() const {return fOptDate;}
BeamtestPeriod_t GetBeamTestPeriod() const {return fPeriod;}
- AliITS* GetBeamTestGeometry() const {return fBt;}
+
protected:
TString fRawdataFileName; //Raw data file name
BeamtestPeriod_t fPeriod; //Beam test period
- AliITS* fBt; //! Local pointer to ITS geometry.
-
AliRunLoader* fRunLoader; // Local pointer to run loader
AliITSLoader* fLoader; // Pointer to ITS loader
static const TString fgkDefaultDigitsFileName; // default name for dig. file
- ClassDef(AliITSBeamTestDigitizer,2) // An Alice SDD beam test digitization class
+ ClassDef(AliITSBeamTestDigitizer,3) // An Alice SDD beam test digitization class
};
////////////////////////////////////////////////////////////////////////////
#include "AliITSClusterFinder.h"
-#include "AliITSclusterV2.h"
#include "AliITSRecPoint.h"
-#include "AliITSdigitSPD.h"
-#include "AliITSdigitSDD.h"
-#include "AliITSdigitSSD.h"
+#include "AliITSdigit.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSgeom.h"
#include "AliITSMap.h"
-#include "AliRun.h"
-#include "AliMC.h"
-#include "AliITS.h"
-#include "TParticle.h"
ClassImp(AliITSClusterFinder)
// none.
// Return:
// A default constructed AliITSCulsterFinder
- Init();
}
//----------------------------------------------------------------------
AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg,
SetNperMax();
SetClusterSize();
SetDeclusterFlag();
- Init();
}
//----------------------------------------------------------------------
AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg,
SetNperMax();
SetClusterSize();
SetDeclusterFlag();
- Init();
}
//______________________________________________________________________
AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source) : TObject(source) {
fDeclusterFlag= 0;
fClusterSize = 0;
fNPeaks = 0;
- fITS = 0;
-}
+ // fITS = 0;
+ fDetTypeRec = 0;
+ fITSgeom = 0;
+}
//__________________________________________________________________________
-void AliITSClusterFinder::Init(){
-
- //Initialisation of ITS geometry
+void AliITSClusterFinder::InitGeometry(){
- fITS = (AliITS*)gAlice->GetModule("ITS");
- AliITSgeom *geom=(AliITSgeom*)fITS->GetITSgeom();
- Int_t mmax=geom->GetIndexMax();
+ //Initialisation of ITS geometry
+ if(!fITSgeom) {
+ Error("InitGeometry","ITS geom is null!");
+ return;
+ }
+ Int_t mmax=fITSgeom->GetIndexMax();
if (mmax>2200) {
Fatal("AliITSClusterFinder","Too many ITS subdetectors !");
}
Int_t m;
for (m=0; m<mmax; m++) {
- Int_t lay,lad,det; geom->GetModuleId(m,lay,lad,det);
- Float_t x,y,z; geom->GetTrans(lay,lad,det,x,y,z);
- Double_t rot[9]; geom->GetRotMatrix(lay,lad,det,rot);
+ Int_t lay,lad,det; fITSgeom->GetModuleId(m,lay,lad,det);
+ Float_t x,y,z; fITSgeom->GetTrans(lay,lad,det,x,y,z);
+ Double_t rot[9]; fITSgeom->GetRotMatrix(lay,lad,det,rot);
Double_t alpha=TMath::ATan2(rot[1],rot[0])+TMath::Pi();
Double_t ca=TMath::Cos(alpha), sa=TMath::Sin(alpha);
fYshift[m] = x*ca + y*sa;
fZshift[m] = (Double_t)z;
- fNdet[m] = (lad-1)*geom->GetNdetectors(lay) + (det-1);
+ fNdet[m] = (lad-1)*fITSgeom->GetNdetectors(lay) + (det-1);
fNlayer[m] = lay-1;
}
-
}
+
//----------------------------------------------------------------------
void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c){
// Add a raw cluster copy to the list
// Return:
// none.
- fITS->AddCluster(branch,c);
- fNRawClusters++;
+ if(!fDetTypeRec) {
+ Error("AddCluster","fDetTypeRec is null!");
+ return;
+ }
+ fDetTypeRec->AddCluster(branch,c);
+ fNRawClusters++;
}
//----------------------------------------------------------------------
void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c,
// none.
// Return:
// none.
+ if(!fDetTypeRec) {
+ Error("AddCluster","fDetTypeRec is null!");
+ return;
+ }
- fITS->AddCluster(branch,c);
- fNRawClusters++;
- fITS->AddRecPoint(rp);
-}
+ fDetTypeRec->AddCluster(branch,c);
+ fNRawClusters++;
+ fDetTypeRec->AddRecPoint(rp);
+}
+/*
//______________________________________________________________________
void AliITSClusterFinder::CheckLabels(Int_t lab[3]) {
//------------------------------------------------------------
}
}
-
+*/
//______________________________________________________________________
void AliITSClusterFinder::FindRawClusters(Int_t module){
// Default Cluster finder.
}
//______________________________________________________________________
-void AliITSClusterFinder::Print(ostream *os){
+void AliITSClusterFinder::Print(ostream *os) const{
//Standard output format for this class
// Inputs:
// ostream *os Output stream
*os << fClusterSize<<",";
*os << fNPeaks<<endl;
}
+/*
//______________________________________________________________________
void AliITSClusterFinder::RecPoints2Clusters
(const TClonesArray *points, Int_t idx, TClonesArray *clusters) {
// Conversion AliITSRecPoint -> AliITSclusterV2 for the ITS
// subdetector indexed by idx
//------------------------------------------------------------
- AliITSgeom* geom = (AliITSgeom*)fITS->GetITSgeom();
- Int_t lastSPD1=geom->GetModuleIndex(2,1,1)-1;
+ if(!fITSgeom) {
+ Error("RecPoints2Clusters","ITS geom is null!");
+ return;
+ }
+ Int_t lastSPD1=fITSgeom->GetModuleIndex(2,1,1)-1;
TClonesArray &cl=*clusters;
Int_t ncl=points->GetEntriesFast();
for (Int_t i=0; i<ncl; i++) {
new (cl[i]) AliITSclusterV2(lab,lp, dummy);
}
}
-
+*/
//______________________________________________________________________
-void AliITSClusterFinder::Read(istream *is){
+void AliITSClusterFinder::Read(istream *is) {
//Standard input for this class
// Inputs:
// istream *is Input stream
class AliITSresponse;
class AliITSsegmentation;
class AliITSRawCluster;
-class AliITS;
+class AliITSgeom;
class AliITSdigit;
class AliITSRecPoint;
+class AliITSDetTypeRec;
//----------------------------------------------------------------------
class AliITSClusterFinder :public TObject{
void SetNoDebug(){fDebug=0;}
// Returns the debug flag value
Bool_t GetDebug(Int_t level=1)const {return fDebug>=level;}
+
+ void SetITSgeom(AliITSgeom* geom) {fITSgeom=geom;}
+ AliITSgeom* GetITSgeom() const {return fITSgeom;}
//
// Setters and Getters
// segmentation
//split by local maxima
virtual void SplitByLocalMaxima(AliITSRawCluster *){}
// IO functions
- void Print(ostream *os); // Class ascii print function
+ void Print(ostream *os) const; // Class ascii print function
void Read(istream *os); // Class ascii read function
virtual void Print(Option_t *option="") const {TObject::Print(option);}
virtual Int_t Read(const char *name) {return TObject::Read(name);}
- // Conversion from RecPoints to V2Clusters
- void RecPoints2Clusters(const TClonesArray *points, Int_t idx, TClonesArray *clusters);
+ virtual void SetDetTypeRec(AliITSDetTypeRec* dtr) {fDetTypeRec=dtr;}
+ AliITSDetTypeRec* GetDetTypeRec() const {return fDetTypeRec;}
+ void InitGeometry();
protected:
// methods
- static void CheckLabels(Int_t lab[3]);
- void Init();
AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
// assignment operator
AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
// and want to keep track of
// the cluster which was splitted
AliITSMap *fMap; //! map
- AliITS *fITS; //! pointer to the ITS
Int_t fNperMax; //! NperMax
Int_t fDeclusterFlag; //! DeclusterFlag
Int_t fClusterSize; //! ClusterSize
Float_t fZshift[2200]; // z-shifts of detector local coor. systems
Int_t fNdet[2200]; // detector index
Int_t fNlayer[2200]; // detector layer
+ AliITSDetTypeRec* fDetTypeRec; //ITS object for reconstruction
+ AliITSgeom* fITSgeom; //!ITS geometry
- ClassDef(AliITSClusterFinder,4) //Class for clustering and reconstruction of space points
+ ClassDef(AliITSClusterFinder,5) //Class for clustering and reconstruction of space points
};
// Input and output functions for standard C++ input/output.
ostream &operator<<(ostream &os,AliITSClusterFinder &source);
// for Silicon //
// Drift Detector //
//////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
-#include <TMath.h>
-#include <math.h>
-#include "AliITS.h"
#include "AliITSClusterFinderSDD.h"
#include "AliITSMapA1.h"
#include "AliITSRawClusterSDD.h"
#include "AliITSRecPoint.h"
#include "AliITSdigitSDD.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSresponseSDD.h"
#include "AliITSsegmentationSDD.h"
#include "AliLog.h"
-#include "AliRun.h"
ClassImp(AliITSClusterFinderSDD)
clusteranodePath, //f
clusterMult, //i
0,0,0,0,0,0,0);//7*i
- fITS->AddCluster(1,&clust);
+ fDetTypeRec->AddCluster(1,&clust);
it = tstop;
} // ilcl
it++;
driftPath,anodePath,
nTsteps,start,stop,
start, stop, 1, k, k );
- fITS->AddCluster( 1, &clust );
+ fDetTypeRec->AddCluster( 1, &clust );
if(AliDebugLevel()>=5) clust.PrintInfo();
nClu++;
} // end if nTsteps
clusterI.SetTsigma( tau[i]*fTimeStep );
clusterI.SetQ( integral[i] );
- fITS->AddCluster( 1, &clusterI );
+ fDetTypeRec->AddCluster( 1, &clusterI );
} // end for i
Clusters()->RemoveAt( j );
delete [] par;
if(dig) rnew.fTracks[1]=dig->GetTrack(1);
if(dig) rnew.fTracks[2]=dig->GetTrack(2);
- fITS->AddRecPoint(rnew);
+ fDetTypeRec->AddRecPoint(rnew);
} // I clusters
// Map()->ClearMap();
}
// //
////////////////////////////////////////////////////////////////////////////
-#include "AliITS.h"
#include "AliITSClusterFinderSPD.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSRawClusterSPD.h"
#include "AliITSRecPoint.h"
#include "AliITSdigitSPD.h"
-#include "AliITSresponseSPD.h"
#include "AliITSsegmentationSPD.h"
#include "AliLog.h"
-#include "AliRun.h"
//#define DEBUG
(Double_t) ndzmin,
(Double_t) ndzmax,
0,GetModule());
- fITS->AddCluster(0,clust);
+ fDetTypeRec->AddCluster(0,clust);
delete clust;
}//end loop on clusters
delete[] ifpad;
rnew.fTracks[0]=tr1clus[i];
rnew.fTracks[1]=tr2clus[i];
rnew.fTracks[2]=tr3clus[i];
- fITS->AddRecPoint(rnew);
+ fDetTypeRec->AddRecPoint(rnew);
} // end for i
}
// **************************************************************************//
///////////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
#include <TArrayI.h>
-#include "AliITS.h"
#include "AliITSClusterFinderSSD.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSMapA1.h"
#include "AliITSRawClusterSSD.h"
#include "AliITSRecPoint.h"
#include "AliITSdigitSSD.h"
#include "AliITSgeom.h"
#include "AliITSpackageSSD.h"
-#include "AliITSresponseSSD.h"
#include "AliITSsegmentationSSD.h"
#include "AliLog.h"
-#include "AliRun.h"
const Bool_t AliITSClusterFinderSSD::fgkSIDEP=kTRUE;
const Bool_t AliITSClusterFinderSSD::fgkSIDEN=kFALSE;
// 3. If necesery, resolves for each group of neighbouring digits
// how many clusters creates it.
// 4. Colculate the x and z coordinate
- Int_t lay, lad, detect;
- AliITSgeom *geom = fITS->GetITSgeom();
-
- SetModule(module);
- geom->GetModuleId(GetModule(),lay, lad, detect);
- if ( lay == 6 ) ((AliITSsegmentationSSD*)GetSeg())->SetLayer(6);
- if ( lay == 5 ) ((AliITSsegmentationSSD*)GetSeg())->SetLayer(5);
-
- InitReconstruction(); //ad. 1
- Map()->FillMap();
- FillDigitsIndex();
- SortDigits();
- FindNeighbouringDigits(); //ad. 2
- //SeparateOverlappedClusters(); //ad. 3
- ClustersToPackages(); //ad. 4
- Map()->ClearMap();
+
+
+ if(!fITSgeom) {
+ Error("FindRawClusters","ITS geom is null!");
+ return;
+ }
+ Int_t lay, lad, detect;
+ SetModule(module);
+ fITSgeom->GetModuleId(GetModule(),lay, lad, detect);
+ if ( lay == 6 ) ((AliITSsegmentationSSD*)GetSeg())->SetLayer(6);
+ if ( lay == 5 ) ((AliITSsegmentationSSD*)GetSeg())->SetLayer(5);
+
+ InitReconstruction(); //ad. 1
+ Map()->FillMap();
+ FillDigitsIndex();
+ SortDigits();
+ FindNeighbouringDigits(); //ad. 2
+ //SeparateOverlappedClusters(); //ad. 3
+ ClustersToPackages(); //ad. 4
+ Map()->ClearMap();
}
//______________________________________________________________________
void AliITSClusterFinderSSD::FindNeighbouringDigits(){
cnew.SetMultN(nstripsN);
cnew.SetQErr(TMath::Abs(SigP-SigN));
cnew.SetNTrack(ntracks);
- fITS->AddCluster(2,&cnew);
+ fDetTypeRec->AddCluster(2,&cnew);
AliITSRecPoint rnew;
rnew.SetX(P*kconv);
rnew.SetZ(N*kconv);
rnew.fTracks[0]=tr[0];
rnew.fTracks[1]=tr[1];
rnew.fTracks[2]=tr[2];
- fITS->AddRecPoint(rnew);
+ fDetTypeRec->AddRecPoint(rnew);
return kTRUE;
+
} // end if
return kFALSE;
}
#include "AliRun.h"
#include "AliITSClusterFinderV2.h"
-#include "AliITSRecPoint.h"
#include "AliITSclusterV2.h"
-#include "AliITSsimulationFastPoints.h"
-#include "AliITS.h"
#include "AliITSgeom.h"
#include <TParticle.h>
#include "AliMC.h"
extern AliRun *gAlice;
-AliITSClusterFinderV2::AliITSClusterFinderV2():AliITSClusterFinder(){
+AliITSClusterFinderV2::AliITSClusterFinderV2(AliITSgeom* geom):AliITSClusterFinder(){
//Default constructor
fEvent = 0;
fModule = 0;
-
- AliITSgeom *geom=(AliITSgeom*)fITS->GetITSgeom();
-
- fNModules = geom->GetIndexMax();
+ fITSgeom = geom;
+ fNModules = fITSgeom->GetIndexMax();
}
//______________________________________________________________________
if (bins[k+max].GetMask() == m) MakeCluster(k+max,max,bins,m,c);
if (bins[k+1 ].GetMask() == m) MakeCluster(k+1 ,max,bins,m,c);
}
-
-//______________________________________________________________________
-Int_t AliITSClusterFinderV2::Hits2Clusters(TTree *hTree, TTree *cTree) {
- //------------------------------------------------------------
- // This function creates ITS clusters
- //------------------------------------------------------------
-
- AliITSgeom *geom=fITS->GetITSgeom();
- Int_t mmax=geom->GetIndexMax();
-
- fITS->InitModules(-1,mmax);
- fITS->FillModules(hTree,0);
-
- TClonesArray *clusters=new TClonesArray("AliITSclusterV2",1000);
- TBranch *branch=cTree->GetBranch("Clusters");
- if (!branch) cTree->Branch("Clusters",&clusters);
- else branch->SetAddress(&clusters);
-
- static TClonesArray *points=fITS->RecPoints();
- AliITSsimulationFastPoints sim;
- Int_t ncl=0;
- for (Int_t m=0; m<mmax; m++) {
- AliITSmodule *mod=fITS->GetModule(m);
- sim.CreateFastRecPoints(mod,m,gRandom);
-
- RecPoints2Clusters(points, m, clusters);
- fITS->ResetRecPoints();
-
- ncl+=clusters->GetEntriesFast();
- cTree->Fill();
- clusters->Clear();
- }
-
- Info("Hits2Clusters","Number of found fast clusters : %d",ncl);
-
- //cTree->Write();
-
- delete clusters;
-
- return 0;
-}
-
////////////////////////////////////////////////////////////////////
#include "AliITSClusterFinder.h"
-
-
-class AliITS;
class AliITSclusterV2;
class AliRawReader;
+class AliITSgeom;
class AliITSClusterFinderV2 : public AliITSClusterFinder {
public:
- AliITSClusterFinderV2();
+ AliITSClusterFinderV2(AliITSgeom* geom);
virtual ~AliITSClusterFinderV2() {;}
void SetEvent(Int_t event) { fEvent=event; }
- virtual void RawdataToClusters(AliRawReader* /*rawReader*/,TClonesArray** /*clusters*/){
+ virtual void RawdataToClusters(AliRawReader* /*rawReader*/,TClonesArray** /*clusters*/) {
Warning("RawdataToClusters","Method not implemented in this class ");}
- virtual Int_t Hits2Clusters(TTree *in, TTree *out);
-
-
-
+
protected:
class Ali1Dcluster {
public:
///////////////////////////////////////////////////////////////////////////
-#include "AliRun.h"
#include "AliITSClusterFinderV2SDD.h"
#include "AliITSclusterV2.h"
+#include "AliITSDetTypeRec.h"
#include "AliRawReader.h"
#include "AliITSRawStreamSDD.h"
#include <TClonesArray.h>
-#include "AliITS.h"
-#include "AliITSgeom.h"
#include "AliITSdigitSDD.h"
ClassImp(AliITSClusterFinderV2SDD)
extern AliRun *gAlice;
-AliITSClusterFinderV2SDD::AliITSClusterFinderV2SDD():AliITSClusterFinderV2(){
+AliITSClusterFinderV2SDD::AliITSClusterFinderV2SDD(AliITSgeom* geom):AliITSClusterFinderV2(geom){
//Default constructor
}
if(clusters) new (cl[ncl]) AliITSclusterV2(c);
else {
- fITS->AddClusterV2(c);
+ fDetTypeRec->AddClusterV2(c);
}
ncl++;
}
class AliITSClusterFinderV2SDD : public AliITSClusterFinderV2 {
public:
- AliITSClusterFinderV2SDD();
+ AliITSClusterFinderV2SDD(AliITSgeom* geom);
virtual ~AliITSClusterFinderV2SDD(){;}
virtual void FindRawClusters(Int_t mod);
virtual void RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters);
// //
///////////////////////////////////////////////////////////////////////////
-#include "AliRun.h"
#include "AliITSClusterFinderV2SPD.h"
#include "AliITSclusterV2.h"
+#include "AliITSDetTypeRec.h"
#include "AliRawReader.h"
#include "AliITSRawStreamSPD.h"
#include <TClonesArray.h>
-#include "AliITS.h"
#include "AliITSgeom.h"
#include "AliITSdigitSPD.h"
extern AliRun *gAlice;
-AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD():AliITSClusterFinderV2(){
+AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD(AliITSgeom* geom):AliITSClusterFinderV2(geom){
//Default constructor
- AliITSgeom *geom=(AliITSgeom*)fITS->GetITSgeom();
+ fITSgeom = geom;
+ fLastSPD1=fITSgeom->GetModuleIndex(2,1,1)-1;
- fLastSPD1=geom->GetModuleIndex(2,1,1)-1;
fNySPD=256; fNzSPD=160;
fYpitchSPD=0.0050;
fZ1pitchSPD=0.0425; fZ2pitchSPD=0.0625;
Int_t info[3] = {ymax-ymin+1,zmax-zmin+1,fNlayer[iModule]};
if(!rawdata){
AliITSclusterV2 cl(milab,hit,info);
- fITS->AddClusterV2(cl);
+ fDetTypeRec->AddClusterV2(cl);
}
else{
Int_t label[4]={milab[0],milab[1],milab[2],milab[3]};
class TClonesArray;
class AliRawReader;
class AliITSRawStream;
+class AliITSgeom;
class AliITSClusterFinderV2SPD : public AliITSClusterFinderV2 {
public:
- AliITSClusterFinderV2SPD();
+ AliITSClusterFinderV2SPD(AliITSgeom* geom);
virtual ~AliITSClusterFinderV2SPD(){;}
virtual void FindRawClusters(Int_t mod);
virtual void RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters);
// //
///////////////////////////////////////////////////////////////////////////
-#include "AliRun.h"
#include "AliITSClusterFinderV2SSD.h"
#include "AliITSclusterV2.h"
+#include "AliITSDetTypeRec.h"
#include "AliRawReader.h"
#include "AliITSRawStreamSSD.h"
#include <TClonesArray.h>
-#include "AliITS.h"
#include "AliITSgeom.h"
#include "AliITSdigitSSD.h"
ClassImp(AliITSClusterFinderV2SSD)
-AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD():AliITSClusterFinderV2(){
+AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD(AliITSgeom* geom):AliITSClusterFinderV2(geom){
//Default constructor
- AliITSgeom* geom = (AliITSgeom*)fITS->GetITSgeom();
-
- fLastSSD1=geom->GetModuleIndex(6,1,1)-1;
+ fITSgeom = geom;
+ fLastSSD1=fITSgeom->GetModuleIndex(6,1,1)-1;
fYpitchSSD=0.0095;
fHwSSD=3.65;
fHlSSD=2.00;
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
ncl++;
cl2->SetChargeRatio(ratio);
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
ncl++;
cl2->SetChargeRatio(ratio);
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
ncl++;
cl2->SetChargeRatio(ratio);
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
ncl++;
cl2->SetChargeRatio(ratio);
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
ncl++;
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
else{
cl2 = new AliITSclusterV2(milab,lp,info);
- fITS->AddClusterV2(*cl2);
+ fDetTypeRec->AddClusterV2(*cl2);
}
ncl++;
cl2->SetChargeRatio(ratio);
class AliITSClusterFinderV2SSD : public AliITSClusterFinderV2 {
public:
- AliITSClusterFinderV2SSD();
+ AliITSClusterFinderV2SSD(AliITSgeom* geom);
virtual ~AliITSClusterFinderV2SSD(){;}
virtual void FindRawClusters(Int_t mod);
virtual void RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters);
const char * inFile_new = "galice.root";
AliRunLoader *rl = AliRunLoader::Open(inFile_new,"Event","read");
rl->LoadgAlice();
+ gAlice=rl->GetAliRun();
Int_t nevents=rl->GetNumberOfEvents();
cout<<"Number of Events:"<<nevents<<endl;
while (eventNumber<=0 || eventNumber>nevents){
Int_t nmodules;
ITS->InitModules(-1,nmodules);
- ITS->SetTreeAddressD(TD);
+ ITS->GetDetTypeSim()->SetTreeAddressD(TD,"ITS");
AliITSDDLRawData *util=new AliITSDDLRawData();
//Verbose level
//SSD
#include <stdlib.h>
-#include <Riostream.h>
#include <TClonesArray.h>
#include <TTree.h>
-#include <TMath.h>
-#include "AliITS.h"
-#include "AliITSgeom.h"
-#include "AliITSdigitSPD.h"
-#include "AliITSdigitSDD.h"
-#include "AliITSdigitSSD.h"
+#include "AliITSdigit.h"
#include "AliITSDDLRawData.h"
#include "AliRawDataHeader.h"
#include "AliITSRawStreamSPD.h"
#ifndef AliITSDDLRAWDATA_H
#define AliITSDDLRAWDATA_H
-class AliITS;
class TTree;
class AliITSDDLRawData:public TObject{
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-////////////////////////////////////////////////////////////////////////
-// This Class owns the classes needed to to detector simulations and
-// reconstruction. This includes the detector segmentation classes,
-// the detector responce classes, the detector simulatin classes, and
-// the detector reconstruction (clustering) classes for all of the ITS
-// detectors.
-////////////////////////////////////////////////////////////////////////
-#include "AliITSDetType.h"
-#include "AliITSClusterFinder.h"
-#include "AliITSsimulation.h"
-
-
-ClassImp(AliITSDetType)
-
-//______________________________________________________________________
-AliITSDetType::AliITSDetType():
-TObject(),
-fDetType(kND),
-fResponse(0),
-fSegmentation(0),
-fSimulation(0),
-fReconst(0),
-fDigClassName(""),
-fClustClassName(""){
- // Default constructor.
- // Inputs:
- // none.
- // Output:
- // none.
- // Return:
- // A default constructed AliITSDetType class.
-}
-//______________________________________________________________________
-AliITSDetType::AliITSDetType(AliITSDetector det,AliITSresponse *res,
- AliITSsegmentation *seg,AliITSsimulation *sim,
- AliITSClusterFinder *cf,
- const Char_t *DigClassName,
- const Char_t *ClustClassName):
-TObject(),
-fDetType(det),
-fResponse(res),
-fSegmentation(seg),
-fSimulation(sim),
-fReconst(cf),
-fDigClassName(DigClassName),
-fClustClassName(ClustClassName){
- // Standard constructor
- // Inputs:
- // AliITSDetector det Detector type
- // AliITSresponse *res response class to use
- // AliITSsegmentation *seg Segmentation class to use
- // AliITSsimulation *sim Simulation class to use
- // AliITSClusterFinder *cf Cluster Finder/Reconstruction class to use
- // const Char_t DigClassName Name of the digit class to be used
- // const Char_t ClustClassName Name of the cluster class to be
- // used
- // Output:
- // none.
- // Return:
- // A Standard constructed AliITSDetType class.
-}
-//----------------------------------------------------------------------
-AliITSDetType::~AliITSDetType(){
- // destructor
- // Inputs:
- // none.
- // Output:
- // none.
- // Return:
- // none.
-
- if(fSegmentation!=0) delete fSegmentation; fSegmentation = 0;
- if(fResponse!=0) delete fResponse; fResponse = 0;
- if(fSimulation!=0) delete fSimulation; fSimulation = 0;
- if(fReconst!=0) delete fReconst; fReconst = 0;
-}
-//______________________________________________________________________
-AliITSDetType::AliITSDetType(const AliITSDetType &source) : TObject(source){
- // Copy Constructor
- // Inputs:
- // const AliITSDetType &source class to copy from.
- // Output:
- // none.
- // Return:
- // none.
-
- if(&source == this) return;
- this->fDetType = source.fDetType;
- this->fReconst = source.fReconst;
- this->fSimulation = source.fSimulation;
- this->fResponse = source.fResponse;
- this->fSegmentation = source.fSegmentation;
- this->fDigClassName = source.fDigClassName;
- this->fClustClassName = source.fClustClassName;
- return;
-}
-//______________________________________________________________________
-AliITSDetType& AliITSDetType::operator=(const AliITSDetType &source){
- // Assignment operator
- // Inputs:
- // const AliITSDetType &source class to copy from.
- // Output:
- // none.
- // Return:
- // a new AliITSDetType class with the same values as in source.
-
- if(&source == this) return *this;
- this->fDetType = source.fDetType;
- this->fReconst = source.fReconst;
- this->fSimulation = source.fSimulation;
- this->fResponse = source.fResponse;
- this->fSegmentation = source.fSegmentation;
- this->fDigClassName = source.fDigClassName;
- this->fClustClassName = source.fClustClassName;
- return *this;
-}
+++ /dev/null
-#ifndef ALIITSDETTYPE_H
-#define ALIITSDETTYPE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-////////////////////////////////////////////////////////////////////////
-// This Class owns the classes needed to to detector simulations and
-// reconstruction. This includes the detector segmentation classes,
-// the detector responce classes, the detector simulatin classes, and
-// the detector reconstruction (clustering) classes for all of the ITS
-// detectors.
-////////////////////////////////////////////////////////////////////////
-
-#include <TString.h>
-#include <TObject.h>
-
-#include "AliITSgeom.h"
-#include "AliITSsegmentation.h"
-#include "AliITSresponse.h"
-
-class AliITSClusterFinder;
-class AliITSsimulation;
-
-class AliITSDetType:public TObject{
-
- public:
- AliITSDetType();
- AliITSDetType(AliITSDetector det,AliITSresponse *res,
- AliITSsegmentation *seg,AliITSsimulation *sim,
- AliITSClusterFinder *cf,const Char_t *DigClassName,
- const Char_t *ClustClassName);
- virtual ~AliITSDetType();
- AliITSDetType(const AliITSDetType &source); // copy constructor
- AliITSDetType& operator=(const AliITSDetType &source); // assign. operator
- // Return the type of detector these quantities are defined for
- AliITSDetector GetDetType(){return fDetType;}
- // Set the type of Detector these quantities are defined for
- void SetDetType(AliITSDetector det){fDetType = det;}
-
- // Set the defaults
- virtual void Init() {}
- //
- virtual void SegmentationModel(AliITSsegmentation* thisSegmentation){
- // Configure segmentation model
- if(fSegmentation) delete fSegmentation;
- fSegmentation=thisSegmentation;
- }
- //
- virtual void ResponseModel(AliITSresponse* thisResponse) {
- // Configure response model
- if(fResponse) delete fResponse;
- fResponse=thisResponse;
- }
- //
- virtual void SimulationModel(AliITSsimulation *thisSimulation) {
- // Configure simulation model
- fSimulation = thisSimulation;
- }
- //
- virtual void ReconstructionModel(AliITSClusterFinder *thisReconstruction) {
- // Configure reconstruction model
- fReconst = thisReconstruction;
- }
- virtual void ClassNames(const char *digit, const char *cluster) {
- // Set class names for digits and clusters
- fDigClassName=digit; fClustClassName=cluster;
- }
- AliITSsegmentation* &GetSegmentationModel(){
- // Get reference to segmentation model
- return fSegmentation;
- }
- AliITSresponse* &GetResponseModel(){
- // Get reference to response model
- return fResponse;
- }
- AliITSsimulation* &GetSimulationModel(){
- // Get reference to simulation model
- return fSimulation;
- }
- AliITSClusterFinder* &GetReconstructionModel(){
- // Get reference to hit reconstruction model
- return fReconst;
- }
- //
- void GetClassNames(char *digit,char *cluster){
- // Get class names for digits and rec points
- strcpy(digit,fDigClassName.Data());
- strcpy(cluster,fClustClassName.Data());
- }
- // Return the Digit Class name
- TString GetDigitClassName() const { return fDigClassName;}
- // Return the Cluster Class name
- TString GetClusterClassName() const { return fClustClassName;}
-
- protected:
- AliITSDetector fDetType; // Type of detector
- AliITSresponse *fResponse; // response
- AliITSsegmentation *fSegmentation; // segmentation
- AliITSsimulation *fSimulation; // simulation
- AliITSClusterFinder *fReconst; // cluster finder
- TString fDigClassName; // string
- TString fClustClassName; // string
-
- ClassDef(AliITSDetType,2) //Detector simulation/reconstruction class holder
-
-};
-
-#endif
$Id$
*/
-/*********************************************************************
- * This class defines the "Standard" reconstruction for the ITS
- * detector.
- **********************************************************************/
+////////////////////////////////////////////////////////////////////////
+// This class defines the "Standard" reconstruction for the ITS //
+// detector. //
+// //
+////////////////////////////////////////////////////////////////////////
+#include "TObjArray.h"
+#include "TTree.h"
+
+#include "AliITSClusterFinder.h"
+#include "AliITSClusterFinderV2.h"
+#include "AliITSClusterFinderV2SPD.h"
+#include "AliITSClusterFinderV2SDD.h"
+#include "AliITSClusterFinderV2SSD.h"
+#include "AliITSClusterFinderSPD.h"
+#include "AliITSClusterFinderSDD.h"
+#include "AliITSClusterFinderSSD.h"
+#include "AliITSclusterV2.h"
+#include "AliITSgeom.h"
#include "AliITSDetTypeRec.h"
+#include "AliITSRawCluster.h"
+#include "AliITSRawClusterSPD.h"
+#include "AliITSRawClusterSDD.h"
+#include "AliITSRawClusterSSD.h"
+#include "AliITSRecPoint.h"
+#include "AliITSresponseSPD.h"
+#include "AliITSresponseSDD.h"
+#include "AliITSresponseSSD.h"
+#include "AliITSsegmentationSPD.h"
+#include "AliITSsegmentationSDD.h"
+#include "AliITSsegmentationSSD.h"
+
+const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
ClassImp(AliITSDetTypeRec)
-//----------------------------------------------------------------------
+//________________________________________________________________
AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
fGeom(), //
fReconstruction(),// [NDet]
fCalibration(), // [NMod]
fPreProcess(), // [] e.g. Find Calibration values
fPostProcess(), // [] e.g. find primary vertex
-fClusters(), //! [NMod][NClusters]
fDigits(), //! [NMod][NDigits]
fClusterClassName(), // String with Cluster class name
fDigClassName(), // String with digit class name.
// none.
// Return:
// A properly zero-ed AliITSDetTypeRec class.
+
+ fGeom = 0;
+ fReconstruction = new TObjArray(fgkNdettypes);
+ fSegmentation = 0;
+ fCalibration = 0;
+ fPreProcess = 0;
+ fPostProcess = 0;
+ fDigits = new TObjArray(fgkNdettypes);
+ fNdtype = new Int_t[fgkNdettypes];
+ fCtype = new TObjArray(fgkNdettypes);
+ fNctype = new Int_t[fgkNdettypes];
+ fRecPoints = new TClonesArray("AliITSRecPoint",1000);
+ fNRecPoints = 0;
+ fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
+ fNClustersV2 = 0;
+
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ fNdtype[i]=0;
+ fNctype[i]=0;
+ }
+
+ SelectVertexer(" ");
+ fLoader = 0;
+}
+//______________________________________________________________________
+AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec &/*rec*/):TObject(/*rec*/){
+ // Copy constructor.
+
+ Error("Copy constructor","Copy constructor not allowed");
+
+}
+//______________________________________________________________________
+AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& /*source*/){
+ // Assignment operator. This is a function which is not allowed to be
+ // done.
+ Error("operator=","Assignment operator not allowed\n");
+ return *this;
}
-//----------------------------------------------------------------------
+
+//_____________________________________________________________________
AliITSDetTypeRec::~AliITSDetTypeRec(){
- // Destructor
+
+ //Destructor
+ if(fGeom) delete fGeom;
+ if(fReconstruction) delete fReconstruction;
+ if(fSegmentation) delete fSegmentation;
+ if(fCalibration) delete fCalibration;
+ if(fPreProcess) delete fPreProcess;
+ if(fPostProcess) delete fPostProcess;
+
+ if(fDigits){
+ fDigits->Delete();
+ delete fDigits;
+ fDigits=0;
+ }
+ if(fRecPoints){
+ fRecPoints->Delete();
+ delete fRecPoints;
+ fRecPoints=0;
+ }
+ if(fClustersV2){
+ fClustersV2->Delete();
+ delete fClustersV2;
+ fClustersV2=0;
+ }
+ if(fCtype) {
+ fCtype->Delete();
+ delete fCtype;
+ fCtype = 0;
+ }
+ delete [] fNctype;
+ if(fLoader) delete fLoader;
+
+}
+//___________________________________________________________________
+void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
+
+ //Set reconstruction model for detector type
+
+ if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes);
+ if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype);
+ fReconstruction->AddAt(clf,dettype);
+}
+//______________________________________________________________________
+AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype){
+
+ //Get reconstruction model for detector type
+ if(fReconstruction==0) {
+ Warning("GetReconstructionModel","fReconstruction is 0!");
+ return 0;
+ }
+ return (AliITSClusterFinder*)fReconstruction->At(dettype);
+}
+
+//______________________________________________________________________
+void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
+
+ //Set segmentation model for detector type
+
+ if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes);
+ if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
+ fSegmentation->AddAt(seg,dettype);
+
+}
+//______________________________________________________________________
+AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){
+
+ //Get segmentation model for detector type
+
+ if(fSegmentation==0) {
+ Warning("GetSegmentationModel","fSegmentation is 0!");
+ return 0;
+ }
+ return (AliITSsegmentation*)fSegmentation->At(dettype);
+
+}
+//_______________________________________________________________________
+void AliITSDetTypeRec::SetCalibrationModel(Int_t module,AliITSresponse *resp){
+
+
+ //Set segmentation model for module number
+ if(fCalibration==0) fCalibration = new TObjArray(fGeom->GetIndexMax());
+ if(fCalibration->At(module)!=0) delete fCalibration->At(module);
+ fCalibration->AddAt(resp,module);
+
+}
+//_______________________________________________________________________
+AliITSresponse* AliITSDetTypeRec::GetCalibrationModel(Int_t module){
+
+ //Get segmentation model for module number
+
+ if(fCalibration==0) {
+ Warning("GetalibrationModel","fResponse is 0!");
+ return 0;
+ }
+ return (AliITSresponse*)fCalibration->At(module);
+}
+
+//______________________________________________________________________
+void AliITSDetTypeRec::SetTreeAddress(){
+ // Set branch address for the Trees.
+
+ TTree *treeR = fLoader->TreeR();
+ TTree *treeD = fLoader->TreeD();
+
+ SetTreeAddressD(treeD);
+ SetTreeAddressR(treeR);
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
+ // Set branch address for the tree of digits.
+
+ const char *det[4] = {"SPD","SDD","SSD","ITS"};
+ TBranch *branch;
+ Char_t* digclass;
+ Int_t i;
+ char branchname[30];
+
+ if(!treeD) return;
+ if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes);
+ for (i=0; i<fgkNdettypes; i++) {
+ digclass = GetDigitClassName(i);
+ if(!(fDigits->At(i))) {
+ fDigits->AddAt(new TClonesArray(digclass,1000),i);
+ }else{
+ ResetDigits(i);
+ }
+ if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]);
+ else sprintf(branchname,"%sDigits%d",det[3],i+1);
+ if (fDigits) {
+ branch = treeD->GetBranch(branchname);
+ if (branch) branch->SetAddress(&((*fDigits)[i]));
+ }
+ }
+}
+
+//_______________________________________________________________________
+TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name,
+ const char *classname,
+ void* address,Int_t size,
+ Int_t splitlevel, const char */*file*/)
+{
+//
+// Makes branch in given tree and diverts them to a separate file
+//
+//
+//
+
+ if (tree == 0x0) {
+ Error("MakeBranchInTree","Making Branch %s Tree is NULL",name);
+ return 0x0;
+ }
+ TBranch *branch = tree->GetBranch(name);
+ if (branch) {
+ return branch;
+ }
+ if (classname){
+ branch = tree->Branch(name,classname,address,size,splitlevel);
+ }
+ else {
+ branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel);
+ }
+
+ return branch;
+}
+
+//____________________________________________________________________
+void AliITSDetTypeRec::SetDefaults(){
+
+ //Set defaults for segmentation and response
+
+
+ if(fGeom==0){
+ Warning("SetDefaults","fGeom is 0!");
+ return;
+ }
+
+ AliITSsegmentation* seg;
+ AliITSresponse* res;
+
+ for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
+ if(dettype==0){
+ seg = new AliITSsegmentationSPD(fGeom);
+ SetSegmentationModel(dettype,seg);
+ }
+ if(dettype==1){
+ res = new AliITSresponseSDD("simulated");
+ seg = new AliITSsegmentationSDD(fGeom,res);
+ SetSegmentationModel(dettype,seg);
+ }
+ if(dettype==2){
+ AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(fGeom);
+ seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
+ seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
+ seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
+
+ SetSegmentationModel(dettype,seg2);
+ }
+
+ }
+
+ for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
+ Int_t dettype = fGeom->GetModuleType(imod);
+ //SPD
+ if(dettype==0){
+ SetCalibrationModel(imod,new AliITSresponseSPD());
+ SetDigitClassName(dettype,"AliITSdigitSPD");
+ SetClusterClassName(dettype,"AliITSRawClusterSPD");
+ }
+ //SDD
+ if(dettype==1){
+ SetCalibrationModel(imod,new AliITSresponseSDD("simulated"));
+ const char *kopt = GetCalibrationModel(imod)->ZeroSuppOption();
+ if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
+ else SetDigitClassName(dettype,"AliITSdigitSDD");
+ SetClusterClassName(dettype,"AliITSRawClusterSDD");
+ }
+ //SSD
+ if(dettype==2){
+ SetCalibrationModel(imod,new AliITSresponseSSD("simulated"));
+ SetDigitClassName(dettype,"AliITSdigitSSD");
+ SetClusterClassName(dettype,"AliITSRawClusterSSD");
+ }
+
+ }
+
+
+}
+
+//________________________________________________________________
+void AliITSDetTypeRec::SetDefaultClusterFinders(){
+
+ //set defaults for standard cluster finder
+
+ if(fGeom==0){
+ Warning("SetDefaults","fGeom is 0!");
+ return;
+ }
+
+ AliITSsegmentation* seg;
+ AliITSresponse* res;
+ AliITSClusterFinder *clf;
+
+ MakeTreeC();
+
+ for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
+ Int_t dettype = fGeom->GetModuleType(imod);
+ //SPD
+ if(dettype==0){
+ if(!GetReconstructionModel(dettype)){
+ seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
+ TClonesArray *dig0 = DigitsAddress(0);
+ TClonesArray *rec0 = ClustersAddress(0);
+ clf = new AliITSClusterFinderSPD(seg,dig0,rec0);
+ SetReconstructionModel(dettype,clf);
+ }
+ }
+ //SDD
+ if(dettype==1){
+ if(!GetReconstructionModel(dettype)){
+ seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
+ res = (AliITSresponse*)GetCalibrationModel(imod);
+ TClonesArray *dig1 = DigitsAddress(1);
+ TClonesArray *rec1 = ClustersAddress(1);
+ clf = new AliITSClusterFinderSDD(seg,res,dig1,rec1);
+ SetReconstructionModel(dettype,clf);
+ }
+
+ }
+ //SSD
+ if(dettype==2){
+ if(!GetReconstructionModel(dettype)){
+ seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
+ TClonesArray* dig2 = DigitsAddress(2);
+ clf = new AliITSClusterFinderSSD(seg,dig2);
+ clf->SetITSgeom(fGeom);
+ SetReconstructionModel(dettype,clf);
+ }
+ }
+
+ }
+
+
+}
+
+//________________________________________________________________
+void AliITSDetTypeRec::SetDefaultClusterFindersV2(){
+
+ //Set defaults for cluster finder V2
+
+ if(fGeom==0){
+ Warning("SetDefaults","fGeom is 0!");
+ return;
+ }
+
+ AliITSsegmentation* seg;
+ AliITSClusterFinder *clf;
+
+ MakeTreeC();
+ for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
+ Int_t dettype = fGeom->GetModuleType(imod);
+ //SPD
+ if(dettype==0){
+ if(!GetReconstructionModel(dettype)){
+ seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
+ clf = new AliITSClusterFinderV2SPD(fGeom);
+ clf->InitGeometry();
+ clf->SetSegmentation(seg);
+ clf->SetDigits(DigitsAddress(0));
+ SetReconstructionModel(dettype,clf);
+
+ }
+ }
+ //SDD
+ if(dettype==1){
+ if(!GetReconstructionModel(dettype)){
+ seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
+ clf = new AliITSClusterFinderV2SDD(fGeom);
+ clf->InitGeometry();
+ clf->SetSegmentation(seg);
+ clf->SetDigits(DigitsAddress(1));
+ SetReconstructionModel(dettype,clf);
+ }
+
+ }
+
+ //SSD
+ if(dettype==2){
+ if(!GetReconstructionModel(dettype)){
+ seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
+ clf = new AliITSClusterFinderV2SSD(fGeom);
+ clf->InitGeometry();
+ clf->SetSegmentation(seg);
+ clf->SetDigits(DigitsAddress(2));
+ SetReconstructionModel(dettype,clf);
+ }
+ }
+
+ }
+
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::MakeBranch(Option_t* option){
+
+ //Creates branches for clusters and recpoints
+ Bool_t cR = (strstr(option,"R")!=0);
+ Bool_t cRF = (strstr(option,"RF")!=0);
+ Bool_t v2 = (strstr(option,"v2")!=0);
+
+ if(cRF)cR = kFALSE;
+
+ if(cR) MakeBranchR(0);
+ if(cRF) MakeBranchRF(0);
+ if(v2) MakeBranchR(0,"v2");
+
+}
+
+//_____________________________________________________________
+void AliITSDetTypeRec::MakeTreeC(){
+
+ //Create a separate tree to store the clusters
+ if(!fLoader){
+ Warning("MakeTreeC","ITS loader is null!");
+ return;
+ }
+ if(fLoader->TreeC()== 0x0) fLoader->MakeTree("C");
+ MakeBranchC();
+}
+
+//______________________________________________________________
+void AliITSDetTypeRec::MakeBranchC(){
+
+ //Make branches in the tree of clusters
+
+ if(!fLoader){
+ Warning("MakeBranchC","ITS loader is null!");
+ return;
+ }
+ TTree* lTC = fLoader->TreeC();
+ if(lTC==0x0){
+ Error("MakeTreeC","Can not get TreeC from loader");
+ return;
+ }
+
+ Int_t buffersize = 4000;
+ Char_t branchname[30];
+ Char_t* cluclass;
+ const char *det[4]={"SPD","SDD","SSD","ITS"};
+
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ cluclass = GetClusterClassName(i);
+ if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
+ if(!ClustersAddress(i)){
+ fCtype->AddAt(new TClonesArray(cluclass,1000),i);
+ }
+ if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
+ else sprintf(branchname,"%sClusters%d",det[3],i+1);
+ if(fCtype && lTC){
+ if(lTC->GetBranch(branchname)){
+ Warning("MakeBranchC","Branch %s already exists in TreeC",branchname);
+ } else{
+ Info("MakeBranchC","Creating branch %s in TreeC",branchname);
+ lTC->Branch(branchname,&((*fCtype)[i]),buffersize);
+ }
+ }
+
+ }
+
+}
+
+//_______________________________________________________________
+void AliITSDetTypeRec::GetTreeC(Int_t event){
+
+ //Get the clusters tree for this event and
+ //sets the branch address
+
+
+ if(!fLoader){
+ Warning("GetTreeC","ITS loader is null!");
+ return;
+ }
+
+ Char_t branchname[30];
+ const char *det[4] = {"SPD","SDD","SSD","ITS"};
+ TTree* lTC = fLoader->TreeC();
+
+ ResetClusters();
+ if(lTC) fLoader->CleanRawClusters();
+
+ TBranch* branch;
+ if(lTC){
+ Char_t* cluclass;
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ cluclass = GetClusterClassName(i);
+ if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
+ if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(cluclass,1000),i);
+ if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
+ else sprintf(branchname,"%sClusters%d",det[3],i+1);
+ if(fCtype){
+ branch = lTC->GetBranch(branchname);
+ if(branch) branch->SetAddress(&((*fCtype)[i]));
+ }
+ }
+ } else{
+ Error("GetTreeC","cannot find clusters Tree for vent %d",event);
+ }
+
+}
+
+//___________________________________________________________________
+void AliITSDetTypeRec::AddCluster(Int_t id, AliITSRawCluster *c){
+
+ // Adds a raw cluster to the list
+ TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
+ switch(id){
+ case 0:
+ new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
+ break;
+ case 1:
+ new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
+ break;
+ case 2:
+ new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
+ break;
+ }
+}
+//___________________________________________________________________
+void AliITSDetTypeRec::ResetDigits(){
+ // Reset number of digits and the digits array for the ITS detector.
+
+ if(!fDigits) return;
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ ResetDigits(i);
+ }
+}
+//___________________________________________________________________
+void AliITSDetTypeRec::ResetDigits(Int_t branch){
+ // Reset number of digits and the digits array for this branch.
+
+ if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
+ if(fNdtype) fNdtype[branch]=0;
+
+}
+
+//__________________________________________________________________
+void AliITSDetTypeRec::ResetClusters(){
+
+ //Resets number of clusters and the cluster array
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ ResetClusters(i);
+ }
+}
+
+//__________________________________________________________________
+void AliITSDetTypeRec::ResetClusters(Int_t i){
+
+ //Resets number of clusters and the cluster array for this branch
+
+ if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
+ if (fNctype) fNctype[i]=0;
+}
+//__________________________________________________________________
+void AliITSDetTypeRec::MakeBranchR(const char *file, Option_t *opt){
+
+ //Creates tree branches for recpoints
+ // Inputs:
+ // cont char *file File name where RecPoints branch is to be written
+ // to. If blank it write the SDigits to the same
+ // file in which the Hits were found.
+
+ if(!fLoader){
+ Warning("MakeBranchR","ITS loader is null!");
+ return;
+ }
+
+ Int_t buffsz = 4000;
+ char branchname[30];
+
+ // only one branch for rec points for all detector types
+ Bool_t oFast= (strstr(opt,"Fast")!=0);
+ Bool_t v2 = (strstr(opt,"v2")!=0);
+
+ Char_t detname[10] = "ITS";
+
+
+ if(oFast){
+ sprintf(branchname,"%sRecPointsF",detname);
+ } else if(v2){
+ sprintf(branchname,"Clusters");
+ } else {
+ sprintf(branchname,"%sRecPoints",detname);
+ }
+
+ if(v2){
+
+ if(!fClustersV2)fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
+ if(fLoader->TreeR()){
+ if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
+ MakeBranchInTree(fLoader->TreeR(),branchname,0,&fClustersV2,buffsz,99,file);
+
+ }
+ }else{
+ if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
+ if (fLoader->TreeR()) {
+ if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
+ 1000);
+ MakeBranchInTree(fLoader->TreeR(),branchname,0,&fRecPoints,buffsz,99,file);
+ } // end if
+ }
+
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){
+ // Set branch address for the Reconstructed points Trees.
// Inputs:
- // none.
+ // TTree *treeR Tree containing the RecPoints.
// Outputs:
- // none.
+ // none.
// Return:
- // Nothing.
+
+ char branchname[30];
+ Char_t namedet[10]="ITS";
+
+ if(!treeR) return;
+ if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
+ TBranch *branch1;
+ sprintf(branchname,"Clusters");
+ branch1 = treeR->GetBranch(branchname);
+ if(branch1){
+ if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
+ branch1->SetAddress(&fClustersV2);
+ }
+ else{
+ TBranch *branch;
+ sprintf(branchname,"%sRecPoints",namedet);
+ branch = treeR->GetBranch(branchname);
+ if (branch) {
+ branch->SetAddress(&fRecPoints);
+ }else {
+ sprintf(branchname,"%sRecPointsF",namedet);
+ branch = treeR->GetBranch(branchname);
+ if (branch) {
+ branch->SetAddress(&fRecPoints);
+ }
+ }
+ }
}
-//----------------------------------------------------------------------
+//____________________________________________________________________
+void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
+ // Add a reconstructed space point to the list
+ // Inputs:
+ // const AliITSRecPoint &r RecPoint class to be added to the tree
+ // of reconstructed points TreeR.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ TClonesArray &lrecp = *fRecPoints;
+ new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::AddClusterV2(const AliITSclusterV2 &r){
+ // Add a reconstructed space point to the list
+ // Inputs:
+ // const AliITSClusterV2 &r class to be added to the tree
+ // of reconstructed points TreeR.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ TClonesArray &lrecp = *fClustersV2;
+ new(lrecp[fNClustersV2++]) AliITSclusterV2(r);
+}
+
+//______________________________________________________________________
+void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt, Bool_t v2){
+ // cluster finding and reconstruction of space points
+ // the condition below will disappear when the geom class will be
+ // initialized for all versions - for the moment it is only for v5 !
+ // 7 is the SDD beam test version
+ // Inputs:
+ // Int_t evNumber Event number to be processed.
+ // Int_t lastentry Offset for module when not all of the modules
+ // are processed.
+ // Option_t *opt String indicating which ITS sub-detectors should
+ // be processed. If ="All" then all of the ITS
+ // sub detectors are processed.
+
+ if(!fGeom){
+ Warning("DigitsToRecPoints","fGeom is null!");
+ return;
+ }
+ if(!fLoader){
+ Warning("DigitsToRecPoints","ITS loader is null!");
+ return;
+ }
+
+ const char *all = strstr(opt,"All");
+ const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
+ strstr(opt,"SSD")};
+ if(!v2) SetDefaultClusterFinders();
+ else SetDefaultClusterFindersV2();
+
+
+ TTree *treeC=fLoader->TreeC();
+ if(!treeC){
+ MakeTreeC();
+ MakeBranchC();
+ }
+ AliITSClusterFinder *rec = 0;
+ Int_t id,module,first=0;
+ for(module=0;module<fGeom->GetIndexMax();module++){
+ id = fGeom->GetModuleType(module);
+ if (!all && !det[id]) continue;
+ if(det[id]) first = fGeom->GetStartDet(id);
+ rec = (AliITSClusterFinder*)GetReconstructionModel(id);
+ TClonesArray *itsDigits = DigitsAddress(id);
+ if (!rec) {
+ Error("DigitsToRecPoints",
+ "The reconstruction class was not instanciated! event=%d",
+ evNumber);
+ exit(1);
+ }
+ ResetDigits();
+ TTree *lTD = fLoader->TreeD();
+ if (all) {
+ lTD->GetEvent(lastentry+module);
+ }else {
+ lTD->GetEvent(lastentry+(module-first));
+ }
+ Int_t ndigits = itsDigits->GetEntriesFast();
+ if(ndigits>0){
+ rec->SetDetTypeRec(this);
+ rec->SetITSgeom(fGeom);
+ rec->SetDigits(DigitsAddress(id));
+ rec->SetClusters(ClustersAddress(id));
+ rec->FindRawClusters(module);
+ } // end if
+ fLoader->TreeR()->Fill();
+ ResetRecPoints();
+ ResetClustersV2();
+ treeC->Fill();
+ ResetClusters();
+ }
+
+ fLoader->WriteRecPoints("OVERWRITE");
+ fLoader->WriteRawClusters("OVERWRITE");
+}
+//______________________________________________________________________
+void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
+ // cluster finding and reconstruction of space points
+ // the condition below will disappear when the geom class will be
+ // initialized for all versions - for the moment it is only for v5 !
+ // 7 is the SDD beam test version
+ // Inputs:
+ // Int_t evNumber Event number to be processed.
+ // Int_t lastentry Offset for module when not all of the modules
+ // are processed.
+ // Option_t *opt String indicating which ITS sub-detectors should
+ // be processed. If ="All" then all of the ITS
+ // sub detectors are processed.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ if(fGeom){
+ Warning("DigitsToRecPoints","fGeom is null!");
+ return;
+ }
+ if(!fLoader){
+ Warning("DigitsToRecPoints","ITS loader is null!");
+ return;
+ }
+
+ SetDefaultClusterFindersV2();
+
+ AliITSClusterFinderV2 *rec = 0;
+ Int_t id=0;
+
+ if(!fLoader->TreeR()) fLoader->MakeTree("R");
+ TTree* cTree = fLoader->TreeR();
+ TClonesArray *array=new TClonesArray("AliITSclusterV2",1000);
+ cTree->Branch("Clusters",&array);
+ delete array;
+
+ TClonesArray** clusters = new TClonesArray*[fGeom->GetIndexMax()];
+ for (Int_t iModule = 0; iModule < fGeom->GetIndexMax(); iModule++) {
+ clusters[iModule] = NULL;
+ }
+ for(id=0;id<3;id++){
+ rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
+ rec->SetITSgeom(fGeom);
+ if (!rec) {
+ Error("DigitsToRecPoints",
+ "The reconstruction class was not instanciated");
+ exit(1);
+ }
+ rec->RawdataToClusters(rawReader,clusters);
+ }
+ Int_t nClusters =0;
+ for(Int_t iModule=0;iModule<fGeom->GetIndexMax();iModule++){
+ array = clusters[iModule];
+ if(!array){
+ Error("DigitsToRecPoints","data for module %d missing!",iModule);
+ array = new TClonesArray("AliITSclusterV2");
+ }
+ cTree->SetBranchAddress("Clusters",&array);
+ cTree->Fill();
+ nClusters+=array->GetEntriesFast();
+ delete array;
+ }
+ fLoader->WriteRecPoints("OVERWRITE");
+
+ delete[] clusters;
+ Info("DigitsToRecPoints", "total number of found clustersV2 in ITS: %d\n",
+ nClusters);
+
+}
+
$Id$
*/
-/**********************************************************************
- * This class contains all of the "external" information needed to do *
- * detector specific reconstruction for the ITS. *
- **********************************************************************/
+////////////////////////////////////////////////////////////////////////
+// This class contains all of the "external" information needed to do //
+// detector specific reconstruction for the ITS. //
+////////////////////////////////////////////////////////////////////////
#include <TObject.h>
#include <TObjArray.h>
#include <TClonesArray.h>
-#include "AliITSgeom.h"
+#include "AliITSLoader.h"
+#include "AliRunLoader.h"
-class AliITSClusterFinder;
class AliITSsegmentation;
-class AliITSresponce;
+class AliITSresponse;
+class AliITSClusterFinder;
+class AliITSRawCluster;
+class AliITSRecPoint;
+class AliITSclusterV2;
+class AliRawReader;
+class AliITSgeom;
class AliITSDetTypeRec : public TObject {
public:
AliITSDetTypeRec(); // Default constructor
+ AliITSDetTypeRec(const AliITSDetTypeRec& rec);
+ AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
+
virtual ~AliITSDetTypeRec(); // Proper Destructor
+ AliITSgeom* GetITSgeom()const{return fGeom;}
+ void SetITSgeom(AliITSgeom *geom) {fGeom=geom;}
+
+ virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
+ AliITSLoader* GetLoader() const {return fLoader;}
+ virtual void SetDefaults();
+ virtual void SetDefaultClusterFinders();
+ virtual void SetDefaultClusterFindersV2();
+ virtual void MakeBranch(Option_t *opt);
+ virtual void SetTreeAddress();
+ virtual void SetTreeAddressD(TTree* treeD);
+
+ virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
+ virtual void SetCalibrationModel(Int_t module, AliITSresponse *cal);
+ virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
+ virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
+ virtual AliITSresponse* GetCalibrationModel(Int_t module);
+ virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype);
+
+ virtual void SetDigitClassName(Int_t i,Char_t *digit)
+ {fDigClassName[i]=digit;}
+ virtual void SetClusterClassName(Int_t i,Char_t *cluster)
+ {fClusterClassName[i]=cluster;}
+ virtual void SetRecPointClassName(Int_t i,Char_t *recpoint)
+ {fRecPointClassName[i]=recpoint;}
+
+ Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
+ Char_t* GetClusterClassName(Int_t i) const {return fClusterClassName[i];}
+ Char_t* GetRecPointClassName(Int_t i) const {return fRecPointClassName[i];}
+
+ TObjArray* GetDigits() const {return fDigits;}
+ Int_t *Ndtype() {return fNdtype;}
+ TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
+ virtual void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
+ //
+ virtual void MakeTreeC();
+ virtual void GetTreeC(Int_t event);
+ virtual void AddCluster(Int_t branch, AliITSRawCluster *c);
+ virtual void ResetClusters();
+ virtual void ResetClusters(Int_t branch);
+ virtual void MakeBranchC();
+ TBranch* MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel, const char */*file*/);
+
+ TObjArray *Ctype() {return fCtype;}
+ Int_t *Nctype() {return fNctype;}
+ TClonesArray *ClustersAddress(Int_t id) const {return ((TClonesArray*)(*fCtype)[id]);}
+ virtual void ResetDigits();
+ virtual void ResetDigits(Int_t branch);
+
+ void MakeBranchR(const char *file, Option_t *opt=" ");
+ void SetTreeAddressR(TTree *treeR);
+ void AddRecPoint(const AliITSRecPoint &p);
+ void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
+ // Return pointer to rec points
+ TClonesArray *RecPoints() {return fRecPoints;}
+ void AddClusterV2(const AliITSclusterV2 &cl);
+ void ResetClustersV2(){if(fClustersV2) fClustersV2->Clear();fNClustersV2=0;}
+ Int_t GetNClustersV2()const {return fNClustersV2;}
+
+ TClonesArray *ClustersV2() {return fClustersV2;}
+
+ void MakeBranchRF(const char *file){MakeBranchR(file,"Fast");}
+ // void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
+ // Option_t *add, Option_t *det, const char *filename);
+ void Digits2Reco(){
+ DigitsToRecPoints(fLoader->GetRunLoader()->GetEventNumber(),0,"All");}
+ void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det,Bool_t v2=kFALSE);
+ void DigitsToRecPoints(AliRawReader* rawReader);
private:
- AliITSgeom *fGeom; //
- TObjArray *fReconstruction;// [NDet]
- TObjArray *fSegmentation; // [NDet]
- TObjArray *fCalibration; // [NMod]
- TObjArray *fPreProcess; // [] e.g. Find Calibration values
- TObjArray *fPostProcess; // [] e.g. find primary vertex
- TObjArray *fClusters; //! [NMod][NClusters]
- TClonesArray *fDigits; //! [NMod][NDigits]
- TString fClusterClassName; // String with Cluster class name
- TString fDigClassName; // String with digit class name.
- TString fRecPointClassName;// String with RecPoint class name
+
+ static const Int_t fgkNdettypes; // number of det. types
+ AliITSgeom *fGeom; // ITS geometry
+ TObjArray *fReconstruction;//! [NDet]
+ TObjArray *fSegmentation; //! [NDet]
+ TObjArray *fCalibration; //! [NMod]
+ TObjArray *fPreProcess; //! [] e.g. Find Calibration values
+ TObjArray *fPostProcess; //! [] e.g. find primary vertex
+ TObjArray *fDigits; //! [NMod][NDigits]
+ Int_t *fNdtype; //! detector types
+ Char_t* fClusterClassName[3]; //! String with Cluster class name
+ Char_t* fDigClassName[3]; //! String with digit class name.
+ Char_t* fRecPointClassName[3];//! String with RecPoint class name
+
+ TObjArray *fCtype; //! List of clusters
+ Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det.
+
+ TClonesArray *fRecPoints; //! List of reconstructed points
+ Int_t fNRecPoints; // Number of rec points
+
+ TClonesArray *fClustersV2; //!List of reconstructed clusters v2
+ Int_t fNClustersV2; //Number of clusters v2
+ TString fSelectedVertexer; // Vertexer selected in CreateVertexer
+ AliITSLoader* fLoader; // ITS loader
ClassDef(AliITSDetTypeRec,1) // ITS Reconstruction structure
-}
+};
+
#endif
$Id$
*/
-/*********************************************************************
- * This class defines the "Standard" reconstruction for the ITS
- * detector.
- **********************************************************************/
+/////////////////////////////////////////////////////////////////////
+// Base simulation functions for ITS //
+// //
+// //
+/////////////////////////////////////////////////////////////////////
+#include "TBranch.h"
+#include "TClonesArray.h"
+#include "TObjArray.h"
+#include "TTree.h"
+
+#include "AliRun.h"
+#include "AliITSdigit.h"
+#include "AliITSdigitSPD.h"
+#include "AliITSdigitSDD.h"
+#include "AliITSdigitSSD.h"
#include "AliITSDetTypeSim.h"
+#include "AliITSgeom.h"
+#include "AliITSpListItem.h"
+#include "AliITSresponseSPD.h"
+#include "AliITSresponseSDD.h"
+#include "AliITSresponseSSD.h"
+#include "AliITSsegmentationSPD.h"
+#include "AliITSsegmentationSDD.h"
+#include "AliITSsegmentationSSD.h"
+#include "AliITSsimulation.h"
+#include "AliITSsimulationSPD.h"
+#include "AliITSsimulationSDD.h"
+#include "AliITSsimulationSSD.h"
+
+
+const Int_t AliITSDetTypeSim::fgkNdettypes = 3;
ClassImp(AliITSDetTypeSim)
fResponse(), // [NMod]
fPreProcess(), // [] e.g. Fill fHitModule with hits
fPostProcess(), // [] e.g. Wright Raw data
-fHitModule(), //! [NMod][Nhits]
-fNhits(0), //! number of hits
-fHits(), //! local pointer
fNSDigits(0), //! number of SDigits
fSDigits(), //! [NMod][NSDigits]
fNDigits(0), //! number of Digits
// none.
// Return:
// A properly zero-ed AliITSDetTypeSim class.
+ fGeom = 0;
+ fSimulation = new TObjArray(fgkNdettypes);
+ fSegmentation = new TObjArray(fgkNdettypes);
+ fResponse = 0;
+ fPreProcess = 0;
+ fPostProcess = 0;
+ fNSDigits = 0;
+ fSDigits = new TClonesArray("AliITSpListItem",1000);
+ fDigits = new TObjArray(fgkNdettypes);
+ fNDigits = new Int_t[fgkNdettypes];
+ fLoader = 0;
}
//----------------------------------------------------------------------
AliITSDetTypeSim::~AliITSDetTypeSim(){
// none.
// Return:
// Nothing.
-
- delete fGeom;
- delete fSimulation;
- delete fSegmentation;
- delete fResponse;
- delete fPreProcess;
- delete fPostProcess;
- delete fHitModule;
- // Do not delete fSDigits Not owned by this class see AliITS
- // Do not delete fDigits Not owned by this class see AliITS
+
+ if(fGeom) delete fGeom;
+ if(fSimulation){
+ fSimulation->Delete();
+ delete fSimulation;
+ fSimulation = 0;
+ }
+
+ if(fSegmentation){
+ fSegmentation->Delete();
+ delete fSegmentation;
+ fSegmentation = 0;
+ }
+
+ if(fResponse){
+ fResponse->Delete();
+ delete fResponse;
+ fResponse = 0;
+ }
+
+ if(fPreProcess){
+ fPreProcess->Delete();
+ delete fPreProcess;
+ fPreProcess = 0;
+ }
+
+ if(fPostProcess){
+ fPostProcess->Delete();
+ delete fPostProcess;
+ fPostProcess = 0;
+ }
+
+ if (fLoader)
+ {
+ fLoader->GetModulesFolder()->Remove(this);
+ }
+
+
+ if (fSDigits) {
+ fSDigits->Delete();
+ delete fSDigits;
+ fSDigits=0;
+ }
+ if (fDigits) {
+ fDigits->Delete();
+ delete fDigits;
+ fDigits=0;
+ }
+
}
//----------------------------------------------------------------------
-AliITSDetTypeSim::AliITSDetTypeSim(const AliITSDetTypeSim &s) : TObject(s){
- // Copy Constructor for object AliITSDetTypeSim
- // Inputs:
- // AliITSDetTypeSim &s The copy Sourse
- // Outputs:
- // none.
- // Return:
- // A new AliITSDetTypeSim Object with the same data as that in the
- // source s.
+AliITSDetTypeSim::AliITSDetTypeSim(const AliITSDetTypeSim &source) : TObject(source){
+ // Copy Constructor for object AliITSDetTypeSim not allowed
+ if(this==&source) return;
+ Error("Copy constructor",
+ "You are not allowed to make a copy of the AliITSDetTypeSim");
+ exit(1);
- if(&s==this) return;
- *this = source;
- return;
+
}
//----------------------------------------------------------------------
-AliITSDetTypeSim::operator=(const AliITSDetTypeSim &s) : TObject(s){
+AliITSDetTypeSim& AliITSDetTypeSim::operator=(const AliITSDetTypeSim &source){
// The = operator for object AliITSDetTypeSim
- // Inputs:
- // AliITSDetTypeSim &s The copy Sourse
- // Outputs:
- // none.
- // Return:
- // A new AliITSDetTypeSim Object with the same data as that in the
- // source s.
-
- if(&s==this) return;
- // Make copies of the objects in the arrays as well
- this->fGeom = new AliITSgeom(s.fGeom);// Create a new instance
- if(this->fSimulation!=0) delete this->fSimulation;
- this->fSimulation = new TObjArray(s.fSimulation->GetSize(),
- s.fSimulation->LowerBound());
- for(i=0;i<s.fSimulation->GetSize();i++) if(s.fSimulation[i]!=0)
- this->fSimulation[i] = new AliITSsimulation(*(s.fSimulation[i]));
- else this->fSimulation[i] = 0;
- if(this->fSegmentation!=0) delete this->fSegentation;
- this->fSegmentation = new TObjArray(s.fSegmentation->GetSize(),
- s.fSegmentation->GetLowerBound());
- for(i=0;i<s.fSegmentation->GetSize();i++) if(s.fSegmentation[i]!=0)
- this->fSegmentation[i] = new AliITSsegmentation(*(s.fSegmentation[i]));
- else this->fSegmentation[i] = 0;
- if(this->fResponse!=0) delete fResponse;
- this->fResponse = new TObjArray(s.fResponse->GetSize(),
- s.fResponse->GetLowerBound());
- for(i=0;i<s.fResponse->GetSize();i++) if(s.Response[i]!=0)
- this->fResponse[i] = new AliITSresponse(*(s.fResponse[i]));
- else this->fResponse[i] = 0;
- this->fPreProcess = s.fPreProcess; // Improper copy
- this->fPostProcess = s.fPostProcess; // Improper copy
- this->fHitModule = s.fHitModule; // Improper copy
- this->fNhits = s.fNhits; //
- this->fHits = s.fHits; // copy pointer address only
- this->fNSDigits = s.fNSDigits; //
- this->fSDigits = s.fSDigits; // copy pointer address only
- this->fNDigits = s.fNDigits; //
- this->fDigits = s.fDigits; // copy pointer address only
- this->fHitClassName = s.fHitClassName;
- this->fSDigitClassName = s.fSDigitClassName;
- this->fDigitClassName = s.FDigitClassName;
+
+ if(&source==this) return *this;
+ Error("operator=","You are not allowed to make a copy of the AliITSDetTypeSIm");
+ exit(1);
return *this;
}
+
+
//______________________________________________________________________
-void AliITSDetTypeSim::InitModules(Int_t size,Int_t &nmodules){
- // Initialize the modules array.
- // Inputs:
- // Int_t size Size of array of the number of modules to be
- // created. If size <=0 then the number of modules
- // is gotten from AliITSgeom class kept in fGeom.
- // Outputs:
- // Int_t &nmodules The number of modules existing.
- // Return:
- // none.
-
- if(fHitModule){
- fHitModule->Delete();
- delete fHitModule;
- } // end fir fITSmoudles
-
- Int_t nl,indexMAX,index;
-
- if(size<=0){ // default to using data stored in AliITSgeom
- if(fGeom==0) {
- Error("InitModules","fGeom not defined");
- return;
- } // end if fGeom==0
- nl = fGeom->GetNlayers();
- indexMAX = fGeom->GetIndexMax();
- nmodules = indexMAX;
- fHitModule = new TObjArray(indexMAX);
- for(index=0;index<indexMAX;index++){
- fHitModule->AddAt( new AliITSmodule(index),index);
- } // end for index
+void AliITSDetTypeSim::SetSimulationModel(Int_t dettype,AliITSsimulation *sim){
+
+ //Set simulation model for detector type
+
+ if(fSimulation==0) fSimulation = new TObjArray(fgkNdettypes);
+ fSimulation->AddAt(sim,dettype);
+}
+//______________________________________________________________________
+AliITSsimulation* AliITSDetTypeSim::GetSimulationModel(Int_t dettype){
+
+ //Get simulation model for detector type
+ if(fSimulation==0) {
+ Warning("GetSimulationModel","fSimulation is 0!");
+ return 0;
+ }
+ return (AliITSsimulation*)(fSimulation->At(dettype));
+}
+//______________________________________________________________________
+AliITSsimulation* AliITSDetTypeSim::GetSimulationModelByModule(Int_t module){
+
+ //Get simulation model by module number
+ if(fGeom==0) {
+ Warning("GetSimulationModelByModule","fGeom is 0!");
+ return 0;
+ }
+
+ return GetSimulationModel(fGeom->GetModuleType(module));
+}
+//______________________________________________________________________
+void AliITSDetTypeSim::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
+
+ //Set segmentation model for detector type
+ if(fSegmentation==0x0) fSegmentation = new TObjArray(fgkNdettypes);
+ fSegmentation->AddAt(seg,dettype);
+
+}
+//______________________________________________________________________
+AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModel(Int_t dettype){
+
+ //Get segmentation model for detector type
+
+ if(fSegmentation==0) {
+ Warning("GetSegmentationModel","fSegmentation is 0!");
+ return 0;
+ }
+ return (AliITSsegmentation*)(fSegmentation->At(dettype));
+
+}
+//_______________________________________________________________________
+AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModelByModule(Int_t module){
+
+ //Get segmentation model by module number
+ if(fGeom==0){
+ Warning("GetSegmentationModelByModule","fGeom is 0!");
+ return 0;
+ }
+ return GetSegmentationModel(fGeom->GetModuleType(module));
+
+}
+//_______________________________________________________________________
+void AliITSDetTypeSim::SetResponseModel(Int_t module,AliITSresponse *resp){
+
+
+ //Set segmentation model for module number
+ if(fResponse==0) fResponse = new TObjArray(fGeom->GetIndexMax());
+ fResponse->AddAt(resp,module);
+}
+//______________________________________________________________________
+void AliITSDetTypeSim::ResetResponse(){
+
+ //resets response array
+ if(fResponse){
+ for(Int_t i=0;i<fResponse->GetEntries();i++){
+ if(fResponse->At(i)) delete (AliITSresponse*)fResponse->At(i);
+ }
+ }
+}
+//______________________________________________________________________
+void AliITSDetTypeSim::ResetSegmentation(){
+
+ //Resets segmentation array
+ if(fSegmentation){
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ if(fSegmentation->At(i)) delete (AliITSsegmentation*)fSegmentation->At(i);
+ }
+ }
+}
+
+//_______________________________________________________________________
+AliITSresponse* AliITSDetTypeSim::GetResponseModel(Int_t module){
+
+ //Get segmentation model for module number
+
+ if(fResponse==0) {
+ Warning("GetResponseModel","fResponse is 0!");
+ return 0;
+ }
+ return (AliITSresponse*)(fResponse->At(module));
+}
+//_______________________________________________________________________
+void AliITSDetTypeSim::SetDefaults(){
+
+ //Set defaults for segmentation and response
+
+
+ if(fGeom==0){
+ Warning("SetDefaults","fGeom is 0!");
+ return;
+ }
+
+ if(!fResponse) fResponse = new TObjArray(fGeom->GetIndexMax());
+
+ AliITSsegmentation* seg;
+ AliITSresponse* res;
+ ResetResponse();
+ ResetSegmentation();
+
+ for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
+ Int_t dettype = fGeom->GetModuleType(imod);
+ //SPD
+ if(dettype==0){
+ if(!GetSegmentationModel(dettype)){
+ seg = new AliITSsegmentationSPD(fGeom);
+ SetSegmentationModel(dettype,seg);
+ }
+ if(!GetResponseModel(imod)){
+ res = new AliITSresponseSPD();
+ SetResponseModel(imod,res);
+ }
+ const char *kData0=(GetResponseModel(imod))->DataType();
+ if (strstr(kData0,"real")) {
+ SetDigitClassName(dettype,"AliITSdigit");
+ } else SetDigitClassName(dettype,"AliITSdigitSPD");
+ }
+ //SDD
+ if(dettype==1){
+ if(!GetResponseModel(imod)){
+ SetResponseModel(imod,new AliITSresponseSDD("simulated"));
+ }
+ if(!GetSegmentationModel(dettype)){
+ res = GetResponseModel(imod);
+ seg = new AliITSsegmentationSDD(fGeom,res);
+ SetSegmentationModel(dettype,seg);
+ }
+ const char *kopt = GetResponseModel(imod)->ZeroSuppOption();
+ if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
+ else SetDigitClassName(dettype,"AliITSdigitSDD");
+ }
+ //SSD
+ if(dettype==2){
+ if(!GetSegmentationModel(dettype)){
+ seg = new AliITSsegmentationSSD(fGeom);
+ SetSegmentationModel(dettype,seg);
+ }
+ if(!GetResponseModel(imod)){
+ SetResponseModel(imod,new AliITSresponseSSD("simulated"));
+ }
+ const char *kData2 = (GetResponseModel(imod))->DataType();
+ if (strstr(kData2,"real")) {
+ SetDigitClassName(dettype,"AliITSdigit");
+ } else SetDigitClassName(dettype,"AliITSdigitSSD");
+
+ }
+
+ }
+
+}
+
+//_______________________________________________________________________
+void AliITSDetTypeSim::SetDefaultSimulation(){
+
+ //Set default simulation for detector type
+
+
+ if(fGeom==0){
+ Warning("SetDefaults","fGeom is 0!");
+ return;
+ }
+
+ if(!fResponse) fResponse = new TObjArray(fGeom->GetIndexMax());
+
+ AliITSsegmentation* seg;
+ AliITSresponse* res;
+ AliITSsimulation* sim;
+
+ for(Int_t idet=0;idet<fgkNdettypes;idet++){
+ //SPD
+ if(idet==0){
+ sim = GetSimulationModel(idet);
+ if(!sim){
+ seg = (AliITSsegmentationSPD*)GetSegmentationModel(idet);
+ res = (AliITSresponseSPD*)GetResponseModel(fGeom->GetStartSPD());
+ sim = new AliITSsimulationSPD(seg,res);
+ SetSimulationModel(idet,sim);
+ } else{
+ sim->SetResponseModel(GetResponseModel(fGeom->GetStartSPD()));
+ sim->SetSegmentationModel((AliITSsegmentationSPD*)GetSegmentationModel(idet));
+ sim->Init();
+ }
+ }
+ //SDD
+ if(idet==1){
+ sim = GetSimulationModel(idet);
+ if(!sim){
+ seg = (AliITSsegmentationSDD*)GetSegmentationModel(idet);
+ res = (AliITSresponseSDD*)GetResponseModel(fGeom->GetStartSDD());
+ sim = new AliITSsimulationSDD(seg,res);
+ SetSimulationModel(idet,sim);
+ } else {
+ sim->SetResponseModel((AliITSresponseSDD*)GetResponseModel(fGeom->GetStartSDD()));
+ sim->SetSegmentationModel((AliITSsegmentationSDD*)GetSegmentationModel(idet));
+ sim->Init();
+ }
+
+ }
+ //SSD
+ if(idet==2){
+ sim = GetSimulationModel(idet);
+ if(!sim){
+ seg = (AliITSsegmentationSSD*)GetSegmentationModel(idet);
+ res = (AliITSresponseSSD*)GetResponseModel(fGeom->GetStartSSD());
+ sim = new AliITSsimulationSSD(seg,res);
+ SetSimulationModel(idet,sim);
+ } else{
+ sim->SetResponseModel((AliITSresponseSSD*)GetResponseModel(fGeom->GetStartSSD()));
+ sim->SetSegmentationModel((AliITSsegmentationSSD*)GetSegmentationModel(idet));
+ sim->Init();
+ }
+
+ }
+
+ }
+}
+
+//___________________________________________________________________
+void AliITSDetTypeSim::SetTreeAddressS(TTree* treeS, Char_t* name){
+ // Set branch address for the ITS summable digits Trees.
+
+ char branchname[30];
+
+ if(!treeS){
+ return;
+ }
+ if (fSDigits == 0x0){
+ fSDigits = new TClonesArray("AliITSpListItem",1000);
+ }
+ TBranch *branch;
+ sprintf(branchname,"%s",name);
+ branch = treeS->GetBranch(branchname);
+ if (branch) branch->SetAddress(&fSDigits);
+
+}
+//___________________________________________________________________
+void AliITSDetTypeSim::SetTreeAddressD(TTree* treeD, Char_t* name){
+ // Set branch address for the digit Trees.
+
+ const char *det[3] = {"SPD","SDD","SSD"};
+ TBranch *branch;
+
+ char branchname[30];
+
+ if(!treeD){
+ return;
+ }
+ if(!fDigits){
+ fDigits = new TObjArray(fgkNdettypes);
+ }
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ Char_t* digclass = GetDigitClassName(i);
+ if(digclass==0x0){
+ if(i==0) SetDigitClassName(i,"AliITSdigitSPD");
+ if(i==1) SetDigitClassName(i,"AliITSdigitSDD");
+ if(i==2) SetDigitClassName(i,"AliITSdigitSSD");
+ digclass = GetDigitClassName(i);
+ }
+ TString classn = digclass;
+ if(!(fDigits->At(i))){
+ fDigits->AddAt(new TClonesArray(classn.Data(),1000),i);
}else{
- fHitModule = new TObjArray(size);
- for(index=0;index<size;index++) {
- fHitModule->AddAt( new AliITSmodule(index),index);
- } // end for index
+ ResetDigits(i);
+ }
+
+ if(fgkNdettypes==3) sprintf(branchname,"%sDigits%s",name,det[i]);
+ else sprintf(branchname,"%sDigits%d",name,i+1);
+ if(fDigits){
+ branch = treeD->GetBranch(branchname);
+ if(branch) branch->SetAddress(&((*fDigits)[i]));
+ }
+ }
- nmodules = size;
- } // end i size<=0
}
+//___________________________________________________________________
+void AliITSDetTypeSim::ResetDigits(){
+ // Reset number of digits and the digits array for the ITS detector.
+
+
+ if(!fDigits){
+ Error("ResetDigits","fDigits is null!");
+ return;
+ }
+ for(Int_t i=0;i<fgkNdettypes;i++){
+ ResetDigits(i);
+ }
+}
+//___________________________________________________________________
+void AliITSDetTypeSim::ResetDigits(Int_t branch){
+ // Reset number of digits and the digits array for this branch.
+
+ if(fDigits->At(branch)){
+ ((TClonesArray*)fDigits->At(branch))->Clear();
+ }
+ if(fNDigits) fNDigits[branch]=0;
+
+}
+
+
+
+//_______________________________________________________________________
+void AliITSDetTypeSim::SDigitsToDigits(Option_t* opt, Char_t* name){
+ // Standard Summable digits to Digits function.
+ if(!fGeom){
+ Warning("SDigitsToDigits","fGeom is null!!");
+ return;
+ }
+
+ const char *all = strstr(opt,"All");
+ const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
+ strstr(opt,"SSD")};
+ if( !det[0] && !det[1] && !det[2] ) all = "All";
+ else all = 0;
+ static Bool_t setDef = kTRUE;
+ if(setDef) SetDefaultSimulation();
+ setDef = kFALSE;
+
+ AliITSsimulation *sim =0;
+ TTree* trees = fLoader->TreeS();
+ if( !(trees && GetSDigits()) ){
+ Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
+ return;
+ }
+ sprintf(name,"%s",name);
+ TBranch* brchSDigits = trees->GetBranch(name);
+
+ Int_t id;
+ for(Int_t module=0;module<fGeom->GetIndexMax();module++){
+ id = fGeom->GetModuleType(module);
+ if (!all && !det[id]) continue;
+ sim = (AliITSsimulation*)GetSimulationModel(id);
+ if(!sim){
+ Error("SDigit2Digits","The simulation class was not "
+ "instanciated for module %d type %s!",module,
+ fGeom->GetModuleTypeName(module));
+ exit(1);
+ }
+ sim->InitSimulationModule(module,gAlice->GetEvNumber());
+
+ fSDigits->Clear();
+ brchSDigits->GetEvent(module);
+ sim->AddSDigitsToModule(fSDigits,0);
+ sim->FinishSDigitiseModule();
+ fLoader->TreeD()->Fill();
+ ResetDigits();
+ }
+ fLoader->TreeD()->GetEntries();
+ fLoader->TreeD()->AutoSave();
+ fLoader->TreeD()->Reset();
+}
+
+
+
+//_________________________________________________________
+void AliITSDetTypeSim::AddSumDigit(AliITSpListItem &sdig){
+
+ //Adds the module full of summable digits to the summable digits tree.
+ TClonesArray &lsdig = *fSDigits;
+ new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
+}
+//__________________________________________________________
+void AliITSDetTypeSim::AddRealDigit(Int_t branch, Int_t *digits){
+ // Add a real digit - as coming from data.
+ TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
+ new(ldigits[fNDigits[branch]++]) AliITSdigit(digits);
+}
+//__________________________________________________________
+void AliITSDetTypeSim::AddSimDigit(Int_t branch, AliITSdigit* d){
+
+ // Add a simulated digit.
+ TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
+ switch(branch){
+ case 0:
+ new(ldigits[fNDigits[branch]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
+ break;
+ case 1:
+ new(ldigits[fNDigits[branch]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
+ break;
+ case 2:
+ new(ldigits[fNDigits[branch]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
+ break;
+ }
+
+
+}
+
//______________________________________________________________________
-void AliITSDetTypeSim::FillModules(TTree *treeH, Int_t mask) {
- // fill the modules with the sorted by module hits;
- // can be called many times to do a merging
- // Inputs:
- // TTree *treeH The tree containing the hits to be copied into
- // the modules.
- // Int_t mask The track number mask to indecate which file
- // this hits came from.
- // Outputs:
- // none.
- // Return:
- // none.
-
- if (treeH == 0x0){Error("FillModules","Tree is NULL");return;}
-
- Int_t lay,lad,det,index;
- AliITShit *itsHit=0;
- AliITSmodule *mod=0;
- TBranch *branch = treeH->GetBranch(fHitClassName.Data());
- if (!branch){Error("FillModules","%s branch in TreeH not found",
- fHitClassName.Data());return;} // end if !branch
- branch->SetAddress(&fHits);
- Int_t nTracks =(Int_t) treeH->GetEntries();
- Int_t iPrimTrack,h;
- for(iPrimTrack=0; iPrimTrack<nTracks; iPrimTrack++){
- ResetHits();
- Int_t nBytes = treeH->GetEvent(iPrimTrack);
- if (nBytes <= 0) continue;
- Int_t nHits = fHits->GetEntriesFast();
- for(h=0; h<nHits; h++){
- itsHit = (AliITShit *)fHits->UncheckedAt(h);
- itsHit->GetDetectorID(lay,lad,det);
- if (fGeom) index = fGeom->GetModuleIndex(lay,lad,det);
- else index=det-1; // This should not be used.
- mod = GetModule(index);
- itsHit->SetTrack(itsHit->GetTrack()+mask); // Set track mask.
- mod->AddHit(itsHit,iPrimTrack,h);
- } // end loop over hits
- } // end loop over tracks
+void AliITSDetTypeSim::AddSimDigit(Int_t branch,Float_t phys,Int_t *digits,
+ Int_t *tracks,Int_t *hits,Float_t *charges){
+ // Add a simulated digit to the list.
+
+ TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
+ AliITSresponseSDD *resp = 0;
+ switch(branch){
+ case 0:
+ new(ldigits[fNDigits[branch]++]) AliITSdigitSPD(digits,tracks,hits);
+ break;
+ case 1:
+ resp = (AliITSresponseSDD*)GetResponseModel(fGeom->GetStartSDD());
+ new(ldigits[fNDigits[branch]++]) AliITSdigitSDD(phys,digits,tracks,
+ hits,charges,resp);
+ break;
+ case 2:
+ new(ldigits[fNDigits[branch]++]) AliITSdigitSSD(digits,tracks,hits);
+ break;
+ }
}
$Id$
*/
-/**********************************************************************
- * This class contains all of the "external" information needed to do *
- * detector specific simulations for the ITS. *
- **********************************************************************/
+/////////////////////////////////////////////////////////////////////////
+// * This class contains all of the "external" information needed to do//
+// * detector specific simulations for the ITS. //
+/////////////////////////////////////////////////////////////////////////
+
#include <TObject.h>
#include <TObjArray.h>
#include <TClonesArray.h>
-#include "AliITSgeom.h"
-
+class AliITSdigit;
+class AliITSmodule;
+class AliITSpListItem;
class AliITSsimulation;
class AliITSsegmentation;
-class AliITSresponce;
+class AliITSresponse;
+class AliLoader;
+class AliITSgeom;
class AliITSDetTypeSim : public TObject {
- public:
- AliITSDetTypeSim(); // Default constructor
- virtual ~AliITSDetTypeSim(); // Proper Destructor
- virtual AliITSDetTypeSim(const AliITSDetTypeSim &source);
-
- // AliITSgeom related functions
- // Return the pointer to the AliITSgeom object for simulation
- AliITSgeom *GetITSgeom() const{return fGeom;}
- // Set the pointer to the AliITSgeom object for simulation
+ public:
+
+ AliITSDetTypeSim();
+ virtual ~AliITSDetTypeSim();
+ AliITSDetTypeSim(const AliITSDetTypeSim &source);
+ AliITSDetTypeSim& operator=(const AliITSDetTypeSim &source);
+ AliITSgeom *GetITSgeom() const {return fGeom;}
void SetITSgeom(AliITSgeom *geom){fGeom=geom;}
+
+ virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim);
+ virtual AliITSsimulation* GetSimulationModel(Int_t dettype);
+ virtual AliITSsimulation* GetSimulationModelByModule(Int_t module);
+
+ virtual void SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg);
+ virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
+ virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module);
+
+ virtual void SetResponseModel(Int_t module,AliITSresponse *resp);
+ virtual AliITSresponse* GetResponseModel(Int_t module);
+
+ TObjArray* GetResponse() const {return fResponse;}
+ TObjArray* GetSegmentation() const {return fSegmentation;}
+ void ResetResponse();
+ void ResetSegmentation();
+
+ virtual void SetLoader(AliLoader* loader) {fLoader=loader;}
+ AliLoader* GetLoader() const {return fLoader;}
+
+ virtual void SetDefaults();
+ virtual void SetDefaultSimulation();
+ virtual void SetTreeAddressS(TTree* treeS, Char_t* name);
+ virtual void SetTreeAddressD(TTree* treeD, Char_t* name);
+
+ virtual void SetSDigits(TClonesArray* sdigits) {fSDigits=sdigits;}
+ virtual void SetDigits(TObjArray* digits) {fDigits=digits;}
+ TClonesArray* GetSDigits() const {return fSDigits;}
+ TObjArray* GetDigits() const {return fDigits;}
+ Int_t* GetNDigitArray() const {return fNDigits;}
+ TClonesArray *DigitsAddress(Int_t id) const { return ((TClonesArray*)(*fDigits)[id]);}
- // AliITSmodule related functions
- // Return Pointer to array of hits by module number
- TObjArray *GetModules(){return fHitModule;}
- // Return Pointer to hits for a specific module number
- AliITSmodule *GetModule(Int_t index){
- return (AliITSmodule*)(fHitModule->At(index));}
-
- // AliITSsimulation related functions
- // Set the simulation model for a give type of detector
- virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim){
- if(fSimulation==0) fSimulation = new TObjArray();
- if(fSimulation->At(dettype)!=0) delete fSimulation->At(dettype);
- fSimulation->AddAt(sim,dettype);}
- // Return the simulation model for a give detector type
- virtual AliITSsimulation* GetSimulationModel(Int_t dettype){
- if(fSimulation==0) return 0; return fSimulation->At(dettype);}
- // Return the simulation model for a given module (checks AliITSgeom)
- virtual AliITSsimulation* GetSimulationModelByModule(Int_t module){
- if(fGeom==0) return 0;
- return GetSimulationModel(fGeom->GetModuleType(module));}
-
- // AliITSsegmentation related functions
- // Set the segmentation model for a give type of detector
- virtual void SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
- if(fSegmentation==0) fSegmentation = new TObjArray();
- if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
- fSegmentation->AddAt(seg,dettype);}
- // Return the segmentation model for a give detector type
- virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype){
- if(fSegmentation==0) return 0; return fSegmentation->At(dettype);}
- // Return the segmentation model for a given module (checks AliITSgeom)
- virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module){
- if(fGeom==0) return 0;
- return GetSegmentationModel(fGeom->GetModuleType(module));}
-
- // AliITSresponse related functions
- // Set the response model for a give module
- virtual void SetResponseModel(Int_t module,AliITSresponse *resp){
- if(fResponse==0) fResponse = new TObjArray();
- if(fResponse->At(module)!=0) delete fResponse->At(module);
- fResponse->AddAt(resp,module);}
- // Return the response model for a give detector type
- virtual AliITSresponse* GetResponseModel(Int_t module){
- if(fResponse==0) return 0; return fResponse->At(module);}
-
- // Sorted hit info
- virtual void InitModules(Int_t size,Int_t &nmodules);
- virtual void FillModules(TTree *treeH, Int_t mask = 0);
- virtual void ClearModules(){if(fHitModule) fHitModule->Delete();};
-
- // TClonesArray of Hits related functions
- virtual void ResetHits(){fNhits=0;if(fHits!=0) fHits->Clear();}
-
- // TClonesArray of SDigits related functions
virtual void ResetSDigits(){fNSDigits=0;if(fSDigits!=0) fSDigits->Clear();}
-
- // TClonesArray of SDigits related functions
- virtual void ResetDigits(){fNDigits=0;if(fDigits!=0) fDigits->Clear();}
-
- private:
- AliITSgeom *fGeom; //
- TObjArray *fSimulation; // [NDet]
- TObjArray *fSegmentation; // [NDet]
- TObjArray *fResponse; // [NMod]
- TObjArray *fPreProcess; // [] e.g. Fill fHitModule with hits
- TObjArray *fPostProcess; // [] e.g. Wright Raw data
- TObjArray *fHitModule; //! [NMod][Nhits]
- Int_t fNhits; //! number of hits
- TClonesArray *fHits; //! Local pointer to hits
+ virtual void ResetDigits();
+ virtual void ResetDigits(Int_t branch);
+ virtual void SDigitsToDigits(Option_t *opt,Char_t* name);
+
+ virtual void AddSumDigit(AliITSpListItem &sdig);
+ virtual void AddRealDigit(Int_t branch, Int_t *digits);
+ virtual void AddSimDigit(Int_t branch, AliITSdigit *d); virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
+ Int_t* tracks,Int_t *hits,Float_t* trkcharges);
+
+ virtual void SetDigitClassName(Int_t i, Char_t* name) {fDigClassName[i]=name;}
+ Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
+
+ private:
+
+ static const Int_t fgkNdettypes; // number of different det. types
+ AliITSgeom *fGeom; // pointer to ITS geom
+ TObjArray *fSimulation; //! [NDet]
+ TObjArray *fSegmentation; //! [NDet]
+ TObjArray *fResponse; //! [NMod]
+ TObjArray *fPreProcess; //! [] e.g. Fill fHitModule with hits
+ TObjArray *fPostProcess; //! [] e.g. Wright Raw data
Int_t fNSDigits; //! number of SDigits
TClonesArray *fSDigits; //! [NMod][NSDigits]
- Int_t fNDigits; //! number of Digits
- TClonesArray *fDigits; //! [NMod][NDigits]
- TString fHitClassName; // String with Hit class name
- TString fSDigClassName;// String with SDigit class name.
- TString fDigClassName; // String with digit class name.
+ Int_t* fNDigits; //! [NDet] number of Digits for det.
+ TObjArray *fDigits; //! [NMod][NDigits]
+ TString fHitClassName; //! String with Hit class name
+ TString fSDigClassName;//! String with SDigit class name.
+ Char_t* fDigClassName[3]; //! String with digit class name.
+ AliLoader* fLoader; // loader
+
+ ClassDef(AliITSDetTypeSim,1) // ITS Simulation structure
+
+};
- ClassDef(AliITSDetTypeSim,1) // ITS Simulation structure
-}
#endif
return;
} // end if !treeD
digDet = new TObjArray(3);
+ its->SetDefaults();
for(det=0;det<3;det++){
- digDet->AddAt(new TClonesArray((its->DetType(det)->
- GetDigitClassName()).Data(),1000),det);
+ digDet->AddAt(new TClonesArray(its->GetDetTypeSim()->
+ GetDigitClassName(det),1000),det);
br = treeD->GetBranch(branchname[det]);
br->SetAddress(&((*digDet)[det]));
} // end for det
**************************************************************************/
/* $Id$ */
-
-//Piotr.Skowronski@cern.ch :
-//Corrections applied in order to compile (only) with new I/O and folder structure
-//To be implemented correctly by responsible
-//
-// Class used to steer
-// the digitization for ITS
-//
-//
+///////////////////////////////////////////////////////////////////////////
+//Piotr.Skowronski@cern.ch : //
+//Corrections applied in order to compile (only) //
+// with new I/O and folder structure //
+//To be implemented correctly by responsible //
+// //
+// Class used to steer //
+// the digitization for ITS //
+// //
+///////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
-#include <Riostream.h>
#include <TClonesArray.h>
#include <TTree.h>
#include <TBranch.h>
#include <AliLoader.h>
#include <AliRunDigitizer.h>
#include "AliITSDigitizer.h"
-#include "AliITSpList.h"
#include "AliITSgeom.h"
#include "AliITSsimulation.h"
-#include "AliITSDetType.h"
ClassImp(AliITSDigitizer)
fRoiifile = 0;
fInit = kFALSE;
}
+
+//______________________________________________________________________
+AliITSDigitizer::AliITSDigitizer(const AliITSDigitizer &/*rec*/):AliDigitizer(/*rec*/){
+ // Copy constructor.
+
+ Error("Copy constructor","Copy constructor not allowed");
+
+}
+//______________________________________________________________________
+AliITSDigitizer& AliITSDigitizer::operator=(const AliITSDigitizer& /*source*/){
+ // Assignment operator. This is a function which is not allowed to be
+ // done.
+ Error("operator=","Assignment operator not allowed\n");
+ return *this;
+}
+
//______________________________________________________________________
AliITSDigitizer::~AliITSDigitizer(){
// Default destructor.
if( !det[0] && !det[1] && !det[2] ) all = "All";
else all = 0;
AliITSsimulation *sim = 0;
- AliITSDetType *iDetType = 0;
- static Bool_t setDef = kTRUE;
-
+ fITS->SetDefaults();
+ fITS->SetDefaultSimulation();
if(!fInit){
Error("Exec","Init not succesfull, aborting.");
return;
} // end if
- if( setDef ) fITS->SetDefaultSimulation();
- setDef = kFALSE;
sprintf(name,"%s",fITS->GetName());
Int_t nfiles = GetManager()->GetNinputs();
Int_t event = GetManager()->GetOutputEventNr();
- Int_t size = fITS->GetITSgeom()->GetIndexMax();
+ Int_t size = fITS->GetITSgeom()->GetIndexMax();
Int_t module,id,ifiles,mask;
Bool_t lmod;
Int_t *fl = new Int_t[nfiles];
Error("Exec","Can not get Output ITS Loader");
return;
}
+
outgime->LoadDigits("update");
if (outgime->TreeD() == 0x0) outgime->MakeTree("D");
for(module=0; module<size; module++ )
{
- if(fModActive && fRoif!=0) if(!fModActive[module]) continue;
- id = fITS->GetITSgeom()->GetModuleType(module);
- if(!all && !det[id]) continue;
- iDetType = fITS->DetType( id );
-
- sim = (AliITSsimulation*)iDetType->GetSimulationModel();
- if(!sim) {
+ if(fModActive && fRoif!=0) if(!fModActive[module]) continue;
+ id = fITS->GetITSgeom()->GetModuleType(module);
+ if(!all && !det[id]) continue;
+ sim = (AliITSsimulation*)fITS->GetSimulationModel(id);
+ if(!sim) {
Error( "Exec", "The simulation class was not instanciated!" );
exit(1);
} // end if !sim
-
- // Fill the module with the sum of SDigits
+ // Fill the module with the sum of SDigits
sim->InitSimulationModule(module, event);
//cout << "Module=" << module;
for(ifiles=0; ifiles<nfiles; ifiles++ )
} // end for ifiles
//cout << " end ifiles loop" << endl;
// Digitize current module sum(SDigits)->Digits
- sim->FinishSDigitiseModule();
+ sim->FinishSDigitiseModule();
// fills all branches - wasted disk space
outgime->TreeD()->Fill();
- fITS->ResetDigits();
+ fITS->ResetDigits();
} // end for module
-
+
outgime->TreeD()->AutoSave();
outgime->WriteDigits("OVERWRITE");
outgime->UnloadDigits();
-
for(ifiles=0; ifiles<nfiles; ifiles++ )
{
inRL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(fl[ifiles]));
sdig->Clear();
delete sdig;
for(Int_t i=0;i<fITS->GetITSgeom()->GetIndexMax();i++) fModActive[i] = kTRUE;
+
+
return;
}
//______________________________________________________________________
-#ifndef ALIITSDIGITZER_H
-#define ALIITSDIGITZER_H
+#ifndef ALIITSDIGITIZER_H
+#define ALIITSDIGITIZER_H
/* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved *
* See cxx source for full Copyright notice */
/*
$Id$
*/
-
+//////////////////////////////////////////////////////////////////
+// Digitizer class for ITS //
+//////////////////////////////////////////////////////////////////
class TObjArray;
class TTree;
public:
AliITSDigitizer();
AliITSDigitizer(AliRunDigitizer *manager);
+ AliITSDigitizer(const AliITSDigitizer& dig);
+ AliITSDigitizer& operator=(const AliITSDigitizer &source);
+
virtual ~AliITSDigitizer();
// Standard routines.
virtual Bool_t Init();
+#include "AliITSEventHeader.h"
////////////////////////////////////////////////////
// Base class to define //
// ITS Event Header //
-//
+// //
// Origin: E. Crescio crescio@to.infn.it //
// //
////////////////////////////////////////////////////
-#include "AliITSEventHeader.h"
-
ClassImp(AliITSEventHeader)
/* $Id$ */
+//////////////////////////////////////////////////////////////////
+// Class for fast reconstruction of recpoints //
+// //
+// //
+//////////////////////////////////////////////////////////////////
+
#include <stdlib.h>
-#include <Riostream.h>
-#include <TObjArray.h>
-#include <TClonesArray.h>
#include <TTree.h>
-#include <TBranch.h>
-#include <TFile.h>
#include <AliRun.h>
#include <AliRunLoader.h>
#include <AliRunDigitizer.h>
#include "AliITSFDigitizer.h"
-// #include "AliITSpList.h"
-#include "AliITSmodule.h"
#include "AliITSgeom.h"
#include "AliITSsimulationFastPoints.h"
fITS = 0;
fInit = kFALSE;
}
+//______________________________________________________________________
+AliITSFDigitizer::AliITSFDigitizer(const AliITSFDigitizer &/*rec*/):AliDigitizer(/*rec*/){
+ // Copy constructor.
+
+ Error("Copy constructor","Copy constructor not allowed");
+
+}
+//______________________________________________________________________
+AliITSFDigitizer& AliITSFDigitizer::operator=(const AliITSFDigitizer& /*source*/){
+
+ // Assignment operator. This is a function which is not allowed to be
+ // done.
+ Error("operator=","Assignment operator not allowed\n");
+ return *this;
+}
+
//______________________________________________________________________
AliITSFDigitizer::~AliITSFDigitizer(){
//
outgime->MakeTree("R");
outputTreeR = outgime->TreeR();
}
- TClonesArray *recPoints = fITS->RecPoints();
-// TBranch *branch =
- fITS->MakeBranchInTree(outputTreeR,"ITSRecPointsF",&recPoints,4000,0);
-
+
+ TClonesArray* recPoints = new TClonesArray("AliITSRecPoint",1000);
+ TBranch* branch = outputTreeR->GetBranch("ITSRecPointsF");
+ if(branch) branch->SetAddress(recPoints);
+ else outputTreeR->Branch("ITSRecPointsF",&recPoints);
Int_t nModules;
fITS->InitModules(-1,nModules);
AliITSgeom *geom = fITS->GetITSgeom();
for(Int_t moduleIndex = 0; moduleIndex<geom->GetIndexMax(); moduleIndex++){
- sim->CreateFastRecPoints(moduleIndex);
-// branch->Fill();
+ sim->CreateFastRecPoints(moduleIndex,recPoints);
outputTreeR->Fill();
- fITS->ResetRecPoints();
+ recPoints->Clear();
}
outrl->WriteRecPoints("OVERWRITE");
// outputTreeR->AutoSave();
-#ifndef ALIITSFDIGITZER_H
-#define ALIITSFDIGITZER_H
+#ifndef ALIITSFDIGITIZER_H
+#define ALIITSFDIGITIZER_H
/* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved *
* See cxx source for full Copyright notice */
/*
$Id$
*/
-
+//////////////////////////////////////////////////////////////////
+// Class for fast reconstruction of recpoints //
+//////////////////////////////////////////////////////////////////
class TObjArray;
class TTree;
-#include <TClonesArray.h> // function of this class used in inline functions.
class AliRunDigitizer;
public:
AliITSFDigitizer();
AliITSFDigitizer(AliRunDigitizer *manager);
+ AliITSFDigitizer(const AliITSFDigitizer& rec);
+ AliITSFDigitizer& operator=(const AliITSFDigitizer &source);
virtual ~AliITSFDigitizer();
// Standard routines.
virtual Bool_t Init();
itsl->LoadRecPoints("recreate");
if (SlowOrFast=='s') itsl->LoadDigits("read");
else itsl->LoadHits("read");
+
+ if(SlowOrFast=='s'){
+ AliITSclustererV2 clusterer(geom);
- AliITSclustererV2 clusterer(geom);
-
- TStopwatch timer;
- if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
- for (Int_t i=0; i<nev; i++) {
+ TStopwatch timer;
+ if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
+ for (Int_t i=0; i<nev; i++) {
cerr<<"Processing event number: "<<i<<endl;
rl->GetEvent(i);
-
+
TTree *out=itsl->TreeR();
if (!out) {
- itsl->MakeTree("R");
- out=itsl->TreeR();
+ itsl->MakeTree("R");
+ out=itsl->TreeR();
}
-
- if (SlowOrFast=='s') {
- TTree *in=itsl->TreeD();
- if (!in) {
- cerr<<"Can't get digits tree !\n";
- return 4;
- }
- clusterer.Digits2Clusters(in,out);
- } else {
- TTree *in=itsl->TreeH();
- if (!in) {
- cerr<<"Can't get hits tree !\n";
- return 5;
- }
- clusterer.Hits2Clusters(in,out);
+
+ TTree *in=itsl->TreeD();
+ if (!in) {
+ cerr<<"Can't get digits tree !\n";
+ return 4;
}
+ clusterer.Digits2Clusters(in,out);
+ itsl->WriteRecPoints("OVERWRITE");
+ timer.Stop(); timer.Print();
+ }
+ } else{
+
+ for(Int_t i=0;i<3;i++){
+ ITS->SetSimulationModel(i,new AliITSsimulationFastPoints());
+ }
+
+ TStopwatch timer;
+ for (Int_t i=0; i<nev; i++) {
+ rl->GetEvent(i);
+ if(itsl->TreeR()== 0x0) itsl->MakeTree("R");
+ TTree* in = (TTree*)itsl->TreeH();
+ TTree* out= (TTree*)itsl->TreeR();
+ timer.Start();
+ ITS->Hits2Clusters(in,out);
+ timer.Stop(); timer.Print();
itsl->WriteRecPoints("OVERWRITE");
+ }
}
- timer.Stop(); timer.Print();
delete rl;
**************************************************************************/
/* $Id$ */
+///////////////////////////////////////////////////////////////////
+//Class for reconstruction of clusters V2 //
+// //
+// //
+///////////////////////////////////////////////////////////////////
-#include <TROOT.h>
#include <TFile.h>
#include <TTree.h>
#include <TBranch.h>
#include "AliRun.h"
#include "AliHeader.h"
-#include "AliITS.h"
#include "AliITSRecPoint.h"
#include "AliITSFindClustersV2.h"
#include "AliITSclusterV2.h"
return;
} // end if !fAr
fDeletfAr = kTRUE; // Since gAlice was read in, delete it.
-
+ /*
AliITS *its = (AliITS*) fAr->GetModule("ITS");
if(!its){
Warning("AliITSFindClusterV2",
"Can't fine the ITS geometry in gAlice. Aborting.");
return;
} // end if !fGeom
+ */
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ fGeom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+ if(!fGeom){
+ Warning("AliITSFindClusterV2",
+ "Can't fine the ITS geometry in gAlice. Aborting.");
+ return;
+ } // end if !fGeom
+ delete rl;
if(fOut) fOut->cd();
fInit = kTRUE;
return;
} // end if !fAr
fDeletfAr = kTRUE; // Since gAlice was read in, delete it.
+ /*
AliITS *its = (AliITS*) fAr->GetModule("ITS");
if(!its){
Warning("AliITSFindClusterV2",
return;
} // end if !its
fGeom = its->GetITSgeom();
+ */
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ fGeom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
if(!fGeom){
Warning("AliITSFindClusterV2",
"Can't fine the ITS geometry in gAlice. Aborting.");
return;
} // end if !fGeom
-
+ delete rl;
+
if(fOut) fOut->cd();
fInit = kTRUE;
}
"ar==0. Aborting.");
return;
} // end if !fAr
- AliITS *its = (AliITS*) fAr->GetModule("ITS");
+
+ /* AliITS *its = (AliITS*) fAr->GetModule("ITS");
if(!its){
Warning("AliITSFindClusterV2",
"Can't fine the ITS in gAlice. Aborting.");
return;
} // end if !its
fGeom = its->GetITSgeom();
+ */
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ fGeom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
if(!fGeom){
Warning("AliITSFindClusterV2",
"Can't fine the ITS geometry in gAlice. Aborting.");
return;
} // end if !fGeom
+ delete rl;
if(fOut) fOut->cd();
fInit = kTRUE;
}
+//______________________________________________________________________
+AliITSFindClustersV2::AliITSFindClustersV2(const AliITSFindClustersV2 &/*rec*/):TTask(/*rec*/){
+ // Copy constructor.
+
+ Error("Copy constructor","Copy constructor not allowed");
+
+}
+//______________________________________________________________________
+AliITSFindClustersV2& AliITSFindClustersV2::operator=(const AliITSFindClustersV2& /*source*/){
+ // Assignment operator. This is a function which is not allowed to be
+ // done.
+ Error("operator=","Assignment operator not allowed\n");
+ return *this;
+}
+
//______________________________________________________________________
AliITSFindClustersV2::~AliITSFindClustersV2(){
// Default constructor.
/*
$Id$
*/
-
+///////////////////////////////////////////////////////////////////
+//Class for reconstruction of clusters V2 //
+///////////////////////////////////////////////////////////////////
#include <TTask.h>
class TString;
AliITSFindClustersV2(TFile *in,TFile *out=0);
// Standard constructor for AliRun already read in.
AliITSFindClustersV2(AliRun *ar, const TString outfile = "");
+ AliITSFindClustersV2(const AliITSFindClustersV2& rec);
+ AliITSFindClustersV2& operator=(const AliITSFindClustersV2 &source);
+
virtual ~AliITSFindClustersV2();//Destructor
virtual Bool_t FastSimulation() const {return fSlowFast;}
virtual void SetSlowSimulation(){fSlowFast = kFALSE;}
/* $Id$ */
-/*
- * Version: 0
- * Written by Bjorn S. Nilsen with code stolen from Andreas Morsch's
- * AliGeant3GeometryGUI class.
- */
#include <ctype.h>
#include "AliITSGeant3Geometry.h"
+/////////////////////////////////////////////////////////////////////////
+// Version: 0 //
+// Written by Bjorn S. Nilsen with code stolen from Andreas Morsch's //
+// AliGeant3GeometryGUI class. //
+// //
+/////////////////////////////////////////////////////////////////////////
ClassImp(AliITSGeant3Geometry)
* See cxx source for full Copyright notice */
/* $Id: */
+///////////////////////////////////////////////////////////////////////
+// Version: 0 //
+// Written by Bjorn S. Nilsen with code stolen from Andreas Morsch's//
+// AliGeant3GeometryGUI class. //
+///////////////////////////////////////////////////////////////////////
#include "TObject.h"
#include "TGeant3.h"
#include <AliRun.h>
#include <AliITS.h>
#include <AliITSgeom.h>
-#include <AliITSDetType.h>
+#include <AliITSDetTypeRec.h>
#include <AliITSRecPoint.h>
#include <AliITSclusterV2.h>
#include <AliITSdigit.h>
Int_t GetClusCoor(TObject *ge, TClonesArray *ITSrec, Int_t mod, TH2F *h2, TH1F *h1, Bool_t verb);
void GetDigits(TObject *tmps,TObject *ge,TClonesArray *ITSdigits, Int_t subd, Int_t mod, Bool_t verbose, TObjArray & histos);
-Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+Rec", char *filename="galice.root", Int_t isfastpoints = 0) {
+Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+ClustersV2", char *filename="galice.root", Int_t isfastpoints = 0) {
/*******************************************************************
* This macro displays geometrical information related to the
* hits, digits and rec points (or V2 clusters) in ITS.
cout<<"Filling modules... It takes a while, now. Please be patient"<<endl;
ITS->FillModules(0,0,nmodules," "," ");
cout<<"ITS modules .... DONE!"<<endl;
-
+
+ AliITSDetTypeRec* detTypeRec = new AliITSDetTypeRec();
+ detTypeRec->SetLoader(ITSloader);
+ detTypeRec->SetITSgeom(ITS->GetITSgeom());
+ detTypeRec->SetDefaults();
// DIGITS
TTree *TD = ITSloader->TreeD();
//RECPOINTS (V2 clusters)
TTree *TR = ITSloader->TreeR();
- TClonesArray *ITSrec = ITS->RecPoints();
+ TClonesArray *ITSrec = detTypeRec->RecPoints();
+ TClonesArray *ITScl = detTypeRec->ClustersV2();
TBranch *branch = 0;
if(userec && TR && ITSrec){
if(isfastpoints==1){
cout<<"WARNING: there are no RECPOINTS on this file ! \n";
cout<<"======================================================= \n \n";
}
- if(useclustersv2 && TR && ITSrec){
-
+ if(useclustersv2 && TR && ITScl){
branch = ITSloader->TreeR()->GetBranch("Clusters");
- if(branch)branch->SetAddress(&ITSrec);
+ if(branch)branch->SetAddress(&ITScl);
}
if(useclustersv2 && (!TR || !ITSrec || !branch)){
cout<<"======================================================= \n \n";
}
// Get segmentation model
- AliITSDetType *iDetType=ITS->DetType(subd);
if(subd==0)detna="SPD";
if(subd==1)detna="SDD";
if(subd==2)detna="SSD";
- AliITSsegmentation *seg=(AliITSsegmentation*)iDetType->GetSegmentationModel();
+ AliITSsegmentation *seg=(AliITSsegmentation*)detTypeRec->GetSegmentationModel(subd);
// Loop on modules
first = geom->GetStartDet(subd);
last = geom->GetLastDet(subd);
//RecPoints
if(userec){
- ITS->ResetRecPoints();
+ detTypeRec->ResetRecPoints();
branch->GetEvent(mod);
TH2F *bidi=(TH2F*)histos.At(6+subd*9);
TH1F *uni=(TH1F*)histos.At(7+subd*9);
nrecp=GetRecCoor(geom,ITSrec,mod,bidi,uni,verbose);
}
if(useclustersv2){
- ITS->ResetRecPoints();
+ detTypeRec->ResetClustersV2();
branch->GetEvent(mod);
TH2F *bidi=(TH2F*)histos.At(6+subd*9);
TH1F *uni=(TH1F*)histos.At(7+subd*9);
- nrecp=GetClusCoor(geom,ITSrec,mod,bidi,uni,verbose);
+ nrecp=GetClusCoor(geom,ITScl,mod,bidi,uni,verbose);
+
}
// Digits
if(usedigits){
- ITS->ResetDigits();
+ detTypeRec->ResetDigits();
nbytes += TD->GetEvent(mod);
GetDigits(seg,geom,ITSdigits,subd,mod,verbose,histos);
}
Int_t GetClusCoor(TObject *ge, TClonesArray *ITSrec, Int_t mod, TH2F *h2, TH1F *h1, Bool_t verb){
+
AliITSgeom *geom = (AliITSgeom*)ge;
Int_t nrecp = ITSrec->GetEntries();
if(nrecp>0){
}
h2->Fill(gc[0],gc[1]);
h1->Fill(gc[2]);
+
}
}
return nrecp;
Float_t GetPz() const {return fPz;} // gets the z momentum component at the fX,fY,fZ point
Double_t GetDz() const {return fDz;} // gets the longitudinal impact parameter
Int_t GetPid() const {return fPid;} // gets the identified particle code
- Double_t GetMass() {return fMass;} // get the tracking mass
- Float_t GetdEdx() {return fdEdx;} //get the track energy loss
+ Double_t GetMass() const {return fMass;} // get the tracking mass
+ Float_t GetdEdx() const {return fdEdx;} //get the track energy loss
void SetMass(Double_t mass) {fMass=mass;} // put the tracking mass
void SetPid(Int_t pid) {fPid=pid;} // put the identified particle code
-#include "AliITS.h"
-#include "AliITSgeom.h"
#include "AliITSdigit.h"
-#include "AliRun.h"
-#include "AliDetector.h"
#include "AliITSLoader.h"
+#include "AliRunLoader.h"
///////////////////////////////////////////////////////////////////////////
// Loader for ITS
const TString AliITSLoader::fgkDefaultVerticesContainerName = "Vertex";
const TString AliITSLoader::fgkDefaultV0ContainerName = "V0";
const TString AliITSLoader::fgkDefaultCascadeContainerName = "Cascade";
-
ClassImp(AliITSLoader)
/**********************************************************************/
dl = GetCascadeDataLoader();
fDataLoaders->Remove(dl);
}
+/*
//----------------------------------------------------------------------
AliITS* AliITSLoader::GetITS(){
// Returns the pointer to the ITS, kept on the file. A short cut metthod
its->SetTreeAddressD(TreeD());
}
+*/
//----------------------------------------------------------------------
void AliITSLoader::SetupDigits(TObjArray *digPerDet,Int_t n,
const Char_t **digclass){
} // end if
return 0;
}
+/*
//---------------------------------------------------------------------
AliITSdigit * AliITSLoader::GetDigit(AliITS *its,Int_t module,Int_t digit){
// Gets the digit for for a specific detector type and module.
} // end if
return 0;
}
+*/
//----------------------------------------------------------------------
void AliITSLoader::MakeTree(Option_t *opt){
// invokes AliLoader::MakeTree + specific ITS tree(s)
const char *oX = strstr(opt,"X");
if (oX) MakeCascadeContainer();
}
+
+//----------------------------------------------------------------------
+AliITSgeom* AliITSLoader::GetITSgeom() {
+ // retrieves the ITS geometry from file
+ AliRunLoader *runLoader = GetRunLoader();
+ if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
+ if (!runLoader->GetAliRun()) {
+ Error("GetITSgeom", "couldn't get AliRun object");
+ return NULL;
+ }
+
+ runLoader->CdGAFile();
+ AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+ if(!geom){
+ Error("GetITSgeom","no ITS geometry available");
+ return NULL;
+ }
+
+ return geom;
+}
+
#ifndef ALIITSLOADER_H
#define ALIITSLOADER_H
-
+//////////////////////////////////////////////////////////
+// Loader class for ITS //
+//////////////////////////////////////////////////////////
#include <AliLoader.h>
#include <AliESDVertex.h>
+#include <AliITSgeom.h>
-class AliITS;
class AliITSdigit;
class TObjArray;
virtual ~AliITSLoader();
void MakeTree(Option_t* opt);
-
- // General ITS shortcuts
- virtual AliITS* GetITS(); // Return pointer to the ITS.
- virtual void SetupDigits(AliITS *its); // Sets up digit using AliITS
- virtual void SetupDigits(TObjArray *digPerDet,Int_t n,
+ virtual void SetupDigits(TObjArray *digPerDet,Int_t n,
const Char_t **digclass); // Sets up digits
// Gets the AliITSdigit for a given module and a specific digit in that
// module. Array of digits stored in AliITS (must use
// SetupDigits(AliITS *its)).
- virtual AliITSdigit* GetDigit(AliITS *its,Int_t module,Int_t digit);
+ // virtual AliITSdigit* GetDigit(AliITS *its,Int_t module,Int_t digit);
// Gets the AliITSdigit for a given module and a specific digit in that
// module. Array of digits stored in a user defined TObjArray digPerDet
virtual AliITSdigit* GetDigit(TObjArray *digPerDet,Int_t module,Int_t digit);
AliESDVertex *GetVertex(){
return static_cast <AliESDVertex*>(GetVertexDataLoader()->
GetBaseLoader(0)->Get());}
-
//V0s
AliDataLoader* GetV0DataLoader() {return GetDataLoader("V0 Vertices");}
virtual void CleanV0s() {GetV0DataLoader()->GetBaseLoader(0)->Clean();}
virtual Int_t WriteBackTracks(Option_t* opt=""){
return GetBackTracksDataLoader()->GetBaseLoader(0)->WriteData(opt);}
+ // Geometry
+ AliITSgeom* GetITSgeom();
protected:
// METHODS
* provided "as is" without express or implied warranty. *
**************************************************************************/
#include <TObjArray.h>
-#include <TMath.h>
-
#include "AliITSMapA1.h"
#include "AliITSsegmentation.h"
-#include "AliITSresponse.h"
#include "AliITSdigit.h"
////////////////////////////////////////////////////////////////////////
return signal;
}
//______________________________________________________________________
-FlagType AliITSMapA1::TestHit(Int_t iz, Int_t ix){
+FlagType AliITSMapA1::TestHit(Int_t iz, Int_t ix) {
// check whether the digit has already been flagged
if (CheckedIndex(iz, ix) < 0) return kEmpty;
#include <TH1.h>
#include <TObjArray.h>
-#include <TMath.h>
#include "AliITSMapA2.h"
#include "AliITSsegmentation.h"
-#include "AliITSresponse.h"
#include "AliITSdigit.h"
////////////////////////////////////////////////////////////////////////
-// AliITSneuralPoint
-//
-// A class which resumes the information of ITS clusters
-// in the global reference frame.
-// Author: A. Pulvirenti
-
+///////////////////////////////////////////////////////////////
+// AliITSneuralPoint //
+// //
+// A class which resumes the information of ITS clusters //
+// in the global reference frame. //
+// Author: A. Pulvirenti //
+///////////////////////////////////////////////////////////////
//#include <stdlib.h>
//#include <Riostream.h>
//
//------------------------------------------------------------------------------------------------------
//
-Int_t* AliITSNeuralPoint::SharedID(AliITSNeuralPoint *p)
+Int_t* AliITSNeuralPoint::SharedID(AliITSNeuralPoint *p) const
{
// Checks if there is a GEANT track owning both
// <this> and the recpoint in the argument
#ifndef ALIITSNEURALPOINT_H
#define ALIITSNEURALPOINT_H
-
-#include <TMath.h>
-
+///////////////////////////////////////////////////////////////
+// AliITSneuralPoint //
+// //
+// A class which resumes the information of ITS clusters //
+// in the global reference frame. //
+// Author: A. Pulvirenti //
+///////////////////////////////////////////////////////////////
class AliITSgeom;
class AliITSgeomMatrix;
class AliITSRecPoint;
void SetUser(Short_t val) {fUser = val;}
Bool_t HasID (Int_t ID) const;
- Int_t* SharedID(AliITSNeuralPoint *p);
+ Int_t* SharedID(AliITSNeuralPoint *p) const;
protected:
//------------------------------------------------------------//
// #include <stdlib.h>
#include "AliITSPid.h"
-#include "TMath.h"
+//#include "TMath.h"
#include <Riostream.h>
#include <TClonesArray.h>
#include <TVector.h>
return ;
}
//------------------------------------------------------------
-void AliITSPid::SetVec(Int_t ntrack,TVector info)
+void AliITSPid::SetVec(Int_t ntrack,TVector info) const
{
//Store track info in tracls table
TClonesArray& arr=*fTrs;
#ifndef ALIITSPID_H
#define ALIITSPID_H
+/////////////////////////////////////////////////////////////////
+// Class for identification of pions,kaons and protons in ITS //
+// Prior particles population (probabilities) are taken from //
+// Hijing event generator. //
+/////////////////////////////////////////////////////////////////
#include <TObject.h>
virtual void Print(Option_t *option="") const {TObject::Print(option);}
void Tab(void);
void Reset(void);
- void SetVec(Int_t track,TVector info);
+ void SetVec(Int_t track,TVector info) const;
TVector* GetVec(Int_t track) const;
Int_t GetPcode(TClonesArray* rps,Float_t pm);
Int_t GetPcode(Float_t p,Float_t pm);
} // end if mod>=0
TClonesArray *rpa;
AliITSRecPoint *rp = 0;
+ AliITSDetTypeRec* rec = new AliITSDetTypeRec();
+ rec->SetLoader(ITSloader);
+ rec->SetITSgeom(ITS->GetITSgeom());
+ rec->SetDefaults();
Int_t event,m,i,i2;
for(event = evNumber1; event < evNumber2; event++){
rl->GetEvent(event);
- ITS->SetTreeAddress();
+ rec->SetTreeAddress();
for(m=mod1;m<mod2;m++){
- ITS->ResetRecPoints();
+ rec->ResetRecPoints();
TTree *TR = ITSloader->TreeR();
TR->GetEvent(m);
- rpa = ITS->RecPoints();
+ rpa = rec->RecPoints();
i2 = rpa->GetEntriesFast();
cout << "Event=" << event << " module=" << m <<
" Number of Recpoints=" << i2 <<endl;
#include "AliRunLoader.h"
#include "AliRawReader.h"
#include "AliITSclustererV2.h"
+#include "AliITSLoader.h"
#include "AliITStrackerMI.h"
#include "AliITStrackerSA.h"
#include "AliITSVertexerIons.h"
#include "AliITSpidESD.h"
#include "AliV0vertexer.h"
#include "AliCascadeVertexer.h"
-#include "AliRun.h"
-#include "AliITS.h"
-
ClassImp(AliITSReconstructor)
-
+
+
//_____________________________________________________________________________
void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
{
// reconstruct clusters
+
AliLoader* loader = runLoader->GetLoader("ITSLoader");
if (!loader) {
Error("Reconstruct", "ITS loader not found");
runLoader->LoadKinematics();
AliITSgeom* geom = GetITSgeom(runLoader);
- if (!geom) return;
+
AliITSclustererV2 clusterer(geom);
Int_t nEvents = runLoader->GetNumberOfEvents();
for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
runLoader->GetEvent(iEvent);
-
TTree* treeClusters = loader->TreeR();
if (!treeClusters) {
loader->MakeTree("R");
Error("Reconstruct", "Can't get digits tree !");
return;
}
-
+
clusterer.Digits2Clusters(treeDigits, treeClusters);
loader->WriteRecPoints("OVERWRITE");
runLoader->UnloadKinematics();
}
+
//_____________________________________________________________________________
void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
AliRawReader* rawReader) const
{
// reconstruct clusters from raw data
- AliLoader* loader = runLoader->GetLoader("ITSLoader");
+ AliITSLoader* loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
if (!loader) {
Error("Reconstruct", "ITS loader not found");
return;
loader->LoadRecPoints("recreate");
AliITSgeom* geom = GetITSgeom(runLoader);
- if (!geom) return;
AliITSclustererV2 clusterer(geom);
Int_t iEvent = 0;
}
loader->UnloadRecPoints();
+
}
//_____________________________________________________________________________
{
// create a ITS tracker
+
AliITSgeom* geom = GetITSgeom(runLoader);
- if (!geom) return NULL;
TString selectedTracker = GetOption();
if (selectedTracker.Contains("MI")) return new AliITStrackerMI(geom);
return new AliITStrackerSA(geom);
+
+
+
}
//_____________________________________________________________________________
Error("GetITSgeom", "couldn't get AliRun object");
return NULL;
}
- AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
- if (!its) {
- Error("GetITSgeom", "couldn't get ITS detector");
+
+ TDirectory * olddir = gDirectory;
+ runLoader->CdGAFile();
+ AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+ olddir->cd();
+ if(!geom){
+ Error("GetITSgeom","no ITS geometry available");
return NULL;
}
- if (!its->GetITSgeom()) {
- Error("GetITSgeom", "no ITS geometry available");
- return NULL;
- }
- return its->GetITSgeom();
+
+ return geom;
}
+
* See cxx source for full Copyright notice */
/* $Id$ */
+///////////////////////////////////////////////////////////////////////////////
+// //
+// class for ITS reconstruction //
+// //
+///////////////////////////////////////////////////////////////////////////////
#include "AliReconstructor.h"
-#include <Riostream.h>
-#include "AliITS.h"
#include "AliITSRiemannFit.h"
#include "AliRun.h"
#include "TClonesArray.h"
#include "stdio.h"
#include "stdlib.h"
#include "Riostream.h"
-#include "TMath.h"
#include "TF1.h"
#include "TGraphErrors.h"
-#include "TStyle.h"
#include "TParticle.h"
#include "TTree.h"
#include "TVector3.h"
#include "AliITSRecPoint.h"
#include "AliITSgeom.h"
-#include "AliITSmodule.h"
#include "AliMC.h"
-
+#include "AliITSDetTypeRec.h"
ClassImp(AliITSRiemannFit)
}
// -----------------------------------------------------------------------
-void AliITSRiemannFit::InitPoints(Int_t ntracks,AliITS *ITS,
- TTree *TR,Int_t nparticles){
+void AliITSRiemannFit::InitPoints(Int_t ntracks,TTree *TR,Int_t nparticles){
//////////////////////////////////////////////////////////////////////
// Fill the class member fPointRecs with the reconstructed points
// Set All other members to the real values
/////////////////////////////////////////////////////////////////////
printf("\n ************* Starting Init Points *************\n");
TParticle *part;
- AliITSgeom *gm = (AliITSgeom*)ITS->GetITSgeom();
+
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ AliITSgeom* gm = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+
//get pointer to modules array
- TObjArray *iTSmodules = ITS->GetModules();
- Int_t nmodules=iTSmodules->GetEntriesFast();
- printf("nmodules = %d \n",nmodules);
+ Int_t nmodules = gm->GetIndexMax();
// Get the points from points file
- AliITSmodule *itsModule;
Int_t mod,irec;
Stat_t nent;
AliITSRecPoint *recp;
nent=TR->GetEntries();
- TClonesArray *iTSrec = ITS->RecPoints();
-
+ AliITSDetTypeRec detTypeRec;
+ TClonesArray *iTSrec = detTypeRec.RecPoints();
Int_t totRP=0;
for (mod=0; mod<nmodules; mod++) {
- itsModule=(AliITSmodule*)iTSmodules->At(mod);
- ITS->ResetRecPoints();
+ detTypeRec.ResetRecPoints();
TR->GetEvent(mod);
Int_t nrecp = iTSrec->GetEntries();
if(!nrecp) continue;
Int_t num=0,nspdi=0,nspdo=0,nsddi=0,nsddo=0,nssdi=0,nssdo=0;
for (mod=0; mod<nmodules; mod++) {
- itsModule=(AliITSmodule*)iTSmodules->At(mod);
- ITS->ResetRecPoints();
+ //itsModule=(AliITSmodule*)iTSmodules->At(mod);
+ //ITS->ResetRecPoints();
+ detTypeRec.ResetRecPoints();
TR->GetEvent(mod);
Int_t nrecp = iTSrec->GetEntries();
if (!nrecp) continue;
- itsModule->GetID(layer,ladder,detector);
+ //itsModule->GetID(layer,ladder,detector);
+ gm->GetModuleId(mod,layer,ladder,detector);
for (irec=0;irec<nrecp;irec++) {
recp = (AliITSRecPoint*)iTSrec->UncheckedAt(irec);
fPLay[3] = nsddo ;
fPLay[4] = nssdi ;
fPLay[5] = nssdo ;
+
+ delete rl;
printf("%d primary tracks in eta=+-1\n",ieta);
printf("%d primary tracks#2 in eta=+-0.5\n",ieta2);
printf("\nInitPoints :\n\nPoints on Layer1 : %d on Layer2 : %d\n",nspdi,nspdo);
* See cxx source for full Copyright notice */
/* $Id$ */
-
+/////////////////////////////////////////////////////////////////////
+// Class for helix fit on the Riemann sphere //
+/////////////////////////////////////////////////////////////////////
#include<TLorentzVector.h>
class TTree;
-class AliITS;
class TVector3;
class AliITSRiemannFit : public TObject{
public:
AliITSRiemannFit();
AliITSRiemannFit(Int_t size,Int_t ntracks);
+ AliITSRiemannFit(const AliITSRiemannFit& rec);
+ AliITSRiemannFit& operator=(const AliITSRiemannFit &source);
+
~AliITSRiemannFit();
class AliPointtl {
public :
Float_t GetdY(Int_t i) const {return this->fPointRecs[i]->GetdY();}
Float_t GetdZ(Int_t i) const {return this->fPointRecs[i]->GetdZ();}
- void InitPoints(Int_t ntracks,AliITS *ITS,TTree *TR,Int_t nparticles);
+ void InitPoints(Int_t ntracks,TTree *TR,Int_t nparticles);
void WritePoints(void);
void ReadPoints(void);
static Int_t SolveCubic(Double_t a,Double_t b,Double_t c,Double_t& x1,Double_t& x2,Double_t& x3);
Double_t &corrLin);
private:
- // copy constructor (NO copy ctr. allowed)
- AliITSRiemannFit(const AliITSRiemannFit& rf );
- // assignment operator (NO assignment allowed)
- AliITSRiemannFit& operator=(const AliITSRiemannFit& /* rf */);
static Double_t Fitfunction(Double_t *x, Double_t* par);
// imposition respectively. The authors thank Mariana Bondila to have help
// them to resolve some problems. July-2000
-#include <Riostream.h>
#include <Riostream.h>
#include <TMath.h>
#include <TBranch.h>
#include <TVector.h>
#include <TFile.h>
+#include <TRandom.h>
#include <TTree.h>
#include "TParticle.h"
#include "AliRun.h"
-#include "AliITS.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSgeomSPD.h"
#include "AliITSgeomSDD.h"
#include "AliITSgeomSSD.h"
//______________________________________________________________________
AliITSTrackerV1::AliITSTrackerV1() {
//Default constructor
- fITS = 0;
+ //fITS = 0;
fresult = 0;
fPtref=0.;
fChi2max=0.;
fRecCylPhi=0;
fRecCylZ=0;
fFieldFactor=0;
+ fDetTypeRec = 0;
}
//______________________________________________________________________
-AliITSTrackerV1::AliITSTrackerV1(AliITS* IITTSS, Int_t evnumber, Bool_t flag) {
+AliITSTrackerV1::AliITSTrackerV1(Int_t evnumber, Bool_t flag) {
//Origin A. Badala' and G.S. Pappalardo:
// e-mail Angela.Badala@ct.infn.it, Giuseppe.S.Pappalardo@ct.infn.it
// Class constructor. It does some initializations.
//PH Initialisation taken from the default constructor
- fITS = IITTSS;
- fresult = 0;
- fPtref = 0.;
- fChi2max =0.;
- frecPoints = 0;
- fvettid = 0;
- fflagvert = flag;
- frl = 0;
- fzmin = 0;
- fzmax = 0;
- fphimin = 0;
- fphimax = 0;
- fphidet = 0;
+ //fITS = IITTSS;
+ fDetTypeRec = new AliITSDetTypeRec();
+ fresult = 0;
+ fPtref = 0.;
+ fChi2max =0.;
+ frecPoints = 0;
+ fvettid = 0;
+ fflagvert = flag;
+ frl = 0;
+ fzmin = 0;
+ fzmax = 0;
+ fphimin = 0;
+ fphimax = 0;
+ fphidet = 0;
- Int_t imax = 200,jmax = 450;
- frl = new AliITSRad(imax,jmax);
-
- ////////// gets information on geometry /////////////////////////////
- AliITSgeom *g1 = fITS->GetITSgeom();
- Int_t ll=1, dd=1;
- TVector det(9);
-
- Int_t ia;
- for(ia=0; ia<6; ia++) {
- fNlad[ia]=g1->GetNladders(ia+1);
- fNdet[ia]=g1->GetNdetectors(ia+1);
- //cout<<fNlad[i]<<" "<<fNdet[i]<<"\n";
- } // end for ia
+ Int_t imax = 200,jmax = 450;
+ frl = new AliITSRad(imax,jmax);
+
+ ////////// gets information on geometry /////////////////////////////
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ AliITSgeom* g1 = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+ Int_t ll=1, dd=1;
+ TVector det(9);
+
+ Int_t ia;
+ for(ia=0; ia<6; ia++) {
+ fNlad[ia]=g1->GetNladders(ia+1);
+ fNdet[ia]=g1->GetNdetectors(ia+1);
+ //cout<<fNlad[i]<<" "<<fNdet[i]<<"\n";
+ } // end for ia
+
//cout<<" mean radius = ";
- Int_t ib;
- for(ib=0; ib<6; ib++) {
- g1->GetCenterThetaPhi(ib+1,ll,dd,det);
- Double_t r1=TMath::Sqrt(det(0)*det(0)+det(1)*det(1));
- g1->GetCenterThetaPhi(ib+1,ll,dd+1,det);
- Double_t r2=TMath::Sqrt(det(0)*det(0)+det(1)*det(1));
- fAvrad[ib]=(r1+r2)/2.;
- //cout<<fAvrad[ib]<<" ";
- } // end for ib
+ Int_t ib;
+ for(ib=0; ib<6; ib++) {
+ g1->GetCenterThetaPhi(ib+1,ll,dd,det);
+ Double_t r1=TMath::Sqrt(det(0)*det(0)+det(1)*det(1));
+ g1->GetCenterThetaPhi(ib+1,ll,dd+1,det);
+ Double_t r2=TMath::Sqrt(det(0)*det(0)+det(1)*det(1));
+ fAvrad[ib]=(r1+r2)/2.;
+ //cout<<fAvrad[ib]<<" ";
+ } // end for ib
//cout<<"\n"; getchar();
-
- fDetx[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDx();
- fDetz[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDz();
-
- fDetx[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDx();
- fDetz[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDz();
+
+ fDetx[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDx();
+ fDetz[0] = ((AliITSgeomSPD*)(g1->GetShape(1, ll, dd)))->GetDz();
+
+ fDetx[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDx();
+ fDetz[1] = ((AliITSgeomSPD*)(g1->GetShape(2, ll, dd)))->GetDz();
fDetx[2] = ((AliITSgeomSDD*)(g1->GetShape(3, ll, dd)))->GetDx();
fDetz[2] = ((AliITSgeomSDD*)(g1->GetShape(3, ll, dd)))->GetDz();
fNRecPoints = new Int_t[numOfModules];
for(Int_t module=0; module<numOfModules; module++) {
- fITS->ResetRecPoints();
- gAlice->TreeR()->GetEvent(module);
- frecPoints=fITS->RecPoints();
+ fDetTypeRec->ResetRecPoints();
+ gAlice->TreeR()->GetEvent(module);
+ frecPoints=fDetTypeRec->RecPoints();
Int_t nRecPoints=fNRecPoints[module]=frecPoints->GetEntries();
fRecCylR[module] = new Double_t[nRecPoints];
fRecCylPhi[module] = new Double_t[nRecPoints];
// fFieldFactor = (Double_t)fieldPointer->Factor();
fFieldFactor =(Double_t)fieldPointer-> SolenoidField()/10/.2;
// cout<< " field factor = "<<fFieldFactor<<"\n"; getchar();
+ delete rl;
+
}
//______________________________________________________________________
AliITSTrackerV1::AliITSTrackerV1(const AliITSTrackerV1 &cobj) : TObject(cobj) {
// e-mail Angela.Badala@ct.infn.it, Giuseppe.S.Pappalardo@ct.infn.it
// copy constructor
- *fITS = *cobj.fITS;
+ // *fITS = *cobj.fITS;
*fresult = *cobj.fresult;
fPtref = cobj.fPtref;
fChi2max = cobj.fChi2max;
} // end for im2
- AliITSgeom *g1 = fITS->GetITSgeom();
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ AliITSgeom* g1 = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+
Int_t numOfModules = g1->GetIndexMax();
/*
fRecCylR = new Float_t *[numOfModules];
fRecCylZ[module][ind]=cobj.fRecCylZ[module][ind];
}
}
+ delete rl;
}
/*
// e-mail Angela.Badala@ct.infn.it, Giuseppe.S.Pappalardo@ct.infn.it
// assignement operator
- *fITS = *obj.fITS;
+ // *fITS = *obj.fITS;
*fresult = *obj.fresult;
fPtref = obj.fPtref;
fChi2max = obj.fChi2max;
} // end for im2
} // end for im1
- AliITSgeom *g1 = fITS->GetITSgeom();
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ AliITSgeom* g1 = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+ // AliITSgeom *g1 = fITS->GetITSgeom();
Int_t numOfModules = g1->GetIndexMax();
fRecCylR = new Double_t *[numOfModules];
fRecCylPhi = new Double_t *[numOfModules];
}
+ delete rl;
return *this;
}
//______________________________________________________________________
if (!digp) { cerr<<"TPC parameters have not been found !\n"; getchar();}
cf->cd();
- TString foldname(fITS->GetLoader()->GetEventFolder()->GetName());
-
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
+ TString foldname(itsl->GetEventFolder()->GetName());
+ //TString foldname(fITS->GetLoader()->GetEventFolder()->GetName());
+ delete rl;
printf("This method is not converted to the NewIO !\n"); //I.B.
return; //I.B.
AliTPCtracker *tracker = new AliTPCtracker(digp); //I.B.
TVector vec(5);
TTree *tr=gAlice->TreeR();
Int_t nent=(Int_t)tr->GetEntries();
- frecPoints = fITS->RecPoints();
+ frecPoints = fDetTypeRec->RecPoints();
Int_t numbpoints;
Int_t totalpoints=0;
for (mod=0; mod<nent; mod++) {
fvettid[mod]=0;
- fITS->ResetRecPoints();
+ fDetTypeRec->ResetRecPoints();
gAlice->TreeR()->GetEvent(mod);
numbpoints = frecPoints->GetEntries();
totalpoints+=numbpoints;
//// for q definition
if(il>1){
if(idmodule>0.){
- fITS->ResetRecPoints();
+ fDetTypeRec->ResetRecPoints();
gAlice->TreeR()->GetEvent(idmodule);
recp=(AliITSRecPoint*)frecPoints->UncheckedAt(idpoint);
q[il-2]=recp->GetQ()*(*fresult).Getfcor(il-2);
sigmazl[5]=0.6889;
///////////////////////////////////////////////////////////
Int_t index;
- AliITSgeom *g1 = fITS->GetITSgeom();
+ AliRunLoader* rl = AliRunLoader::Open("galice.root");
+ rl->CdGAFile();
+ AliITSgeom* g1 = (AliITSgeom*)gDirectory->Get("AliITSgeom");
+
AliITSRecPoint *recp;
for(index =0; index<trackITSlist->GetSize(); index++) {
AliITSTrackV1 *trackITS = (AliITSTrackV1 *) trackITSlist->At(index);
Int_t indexmod;
indexmod = g1->GetModuleIndex(lycur,(Int_t)toucLad(iriv),
(Int_t)toucDet(iriv));