From 7d62fb642e8e534a0745ecf2706ee54afa6ffa5c Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 6 Jul 2005 16:52:59 +0000 Subject: [PATCH] Splitting of the ITS libraries (M.Masera & E.Crescio) --- ALIROOT/binaliroot.pkg | 7 +- DISPLAY/AliDisplayClusters.cxx | 7 +- HLT/ITS/AliL3ITSVertexerZ.cxx | 14 +- ITS/AliCascadeVertex.cxx | 10 +- ITS/AliCascadeVertex.h | 10 +- ITS/AliITS.cxx | 2045 +++++++++----------------- ITS/AliITS.h | 395 +---- ITS/AliITSBeamTest.C | 58 + ITS/AliITSBeamTestDig.cxx | 7 +- ITS/AliITSBeamTestDig.h | 12 +- ITS/AliITSBeamTestDigSDD.cxx | 22 +- ITS/AliITSBeamTestDigSPD.cxx | 20 +- ITS/AliITSBeamTestDigSSD.cxx | 21 +- ITS/AliITSBeamTestDigitizer.cxx | 102 +- ITS/AliITSBeamTestDigitizer.h | 16 +- ITS/AliITSClusterFinder.cxx | 79 +- ITS/AliITSClusterFinder.h | 20 +- ITS/AliITSClusterFinderSDD.cxx | 14 +- ITS/AliITSClusterFinderSPD.cxx | 8 +- ITS/AliITSClusterFinderSSD.cxx | 46 +- ITS/AliITSClusterFinderV2.cxx | 53 +- ITS/AliITSClusterFinderV2.h | 13 +- ITS/AliITSClusterFinderV2SDD.cxx | 8 +- ITS/AliITSClusterFinderV2SDD.h | 2 +- ITS/AliITSClusterFinderV2SPD.cxx | 11 +- ITS/AliITSClusterFinderV2SPD.h | 3 +- ITS/AliITSClusterFinderV2SSD.cxx | 24 +- ITS/AliITSClusterFinderV2SSD.h | 2 +- ITS/AliITSDDLRawData.C | 3 +- ITS/AliITSDDLRawData.cxx | 8 +- ITS/AliITSDDLRawData.h | 1 - ITS/AliITSDetType.cxx | 133 -- ITS/AliITSDetType.h | 110 -- ITS/AliITSDetTypeRec.cxx | 839 ++++++++++- ITS/AliITSDetTypeRec.h | 129 +- ITS/AliITSDetTypeSim.cxx | 669 +++++++-- ITS/AliITSDetTypeSim.h | 171 +-- ITS/AliITSDigitPlot.C | 5 +- ITS/AliITSDigitizer.cxx | 72 +- ITS/AliITSDigitizer.h | 11 +- ITS/AliITSEventHeader.cxx | 5 +- ITS/AliITSFDigitizer.cxx | 43 +- ITS/AliITSFDigitizer.h | 11 +- ITS/AliITSFindClustersV2.C | 58 +- ITS/AliITSFindClustersV2.cxx | 50 +- ITS/AliITSFindClustersV2.h | 7 +- ITS/AliITSGeant3Geometry.cxx | 11 +- ITS/AliITSGeant3Geometry.h | 5 + ITS/AliITSGeoPlot.C | 32 +- ITS/AliITSIOTrack.h | 4 +- ITS/AliITSLoader.cxx | 31 +- ITS/AliITSLoader.h | 17 +- ITS/AliITSMapA1.cxx | 5 +- ITS/AliITSMapA2.cxx | 2 - ITS/AliITSNeuralPoint.cxx | 15 +- ITS/AliITSNeuralPoint.h | 12 +- ITS/AliITSPid.cxx | 4 +- ITS/AliITSPid.h | 7 +- ITS/AliITSPrintRecPoints.C | 10 +- ITS/AliITSReconstructor.cxx | 41 +- ITS/AliITSReconstructor.h | 5 + ITS/AliITSRiemannFit.cxx | 38 +- ITS/AliITSRiemannFit.h | 14 +- ITS/AliITSTrackerV1.cxx | 143 +- ITS/AliITSTrackerV1.h | 9 +- ITS/AliITSVertexer.cxx | 10 +- ITS/AliITSVertexer.h | 1 + ITS/AliITSVertexerIons.cxx | 45 +- ITS/AliITSVertexerIons.h | 7 +- ITS/AliITSVertexerPPZ.cxx | 97 +- ITS/AliITSVertexerPPZ.h | 9 +- ITS/AliITSVertexerZ.cxx | 43 +- ITS/AliITSVertexerZ.h | 4 +- ITS/AliITSclusterSSD.cxx | 16 +- ITS/AliITSclusterSSD.h | 18 +- ITS/AliITSclustererV2.cxx | 61 +- ITS/AliITSclustererV2.h | 1 - ITS/AliITSdcsSSD.cxx | 18 +- ITS/AliITSdcsSSD.h | 42 +- ITS/AliITSdigit.cxx | 11 +- ITS/AliITSdigitSDD.cxx | 38 +- ITS/AliITSdigitSDD.h | 8 +- ITS/AliITSdigitSPD.h | 6 +- ITS/AliITSdigitSSD.h | 3 + ITS/AliITSetfSDD.h | 16 +- ITS/AliITSmodule.cxx | 6 +- ITS/AliITSmodule.h | 31 +- ITS/AliITSpackageSSD.h | 1 - ITS/AliITSreconstruction.cxx | 158 +- ITS/AliITSreconstruction.h | 18 +- ITS/AliITSsimulation.cxx | 6 +- ITS/AliITSsimulation.h | 2 +- ITS/AliITSsimulationFastPoints.cxx | 161 +- ITS/AliITSsimulationFastPoints.h | 6 +- ITS/AliITSsimulationFastPointsV0.cxx | 55 +- ITS/AliITSsimulationFastPointsV0.h | 24 +- ITS/AliITSsimulationSPD.cxx | 6 - ITS/AliITSsimulationSPD.h | 11 +- ITS/AliITStrackSA.cxx | 13 +- ITS/AliITStrackSA.h | 2 +- ITS/AliITStrackerANN.cxx | 6 +- ITS/AliITStrackerSA.cxx | 14 +- ITS/AliITStrackerSA.h | 8 +- ITS/AliITSvBeamTestITS04.cxx | 152 +- ITS/AliITSvBeamTestITS04.h | 4 +- ITS/AliITSvPPRasymmFMD.cxx | 122 +- ITS/AliITSvSDD03.cxx | 210 +-- ITS/AliITSvSPD02.cxx | 149 +- ITS/AliITSvSPD02.h | 8 + ITS/AliITSvSSD03.cxx | 206 +-- ITS/AliITSvSSD03.h | 7 +- ITS/AliITSvtest.cxx | 38 +- ITS/ITSLinkDef.h | 218 --- ITS/ITSbaseLinkDef.h | 73 + ITS/ITSrecLinkDef.h | 85 ++ ITS/ITSsimLinkDef.h | 75 + ITS/libITS.pkg | 143 -- ITS/libITSbase.pkg | 43 + ITS/libITSrec.pkg | 61 + ITS/libITSsim.pkg | 38 + MONITOR/AliMonitorProcess.cxx | 6 +- MONITOR/binmonitorCheck.pkg | 2 +- MONITOR/binmonitorGDC.pkg | 2 +- RAW/binalimdc.pkg | 2 +- build/module.dep | 2 +- macros/loadlibs.C | 4 +- 126 files changed, 4384 insertions(+), 4007 deletions(-) create mode 100644 ITS/AliITSBeamTest.C delete mode 100644 ITS/AliITSDetType.cxx delete mode 100644 ITS/AliITSDetType.h delete mode 100644 ITS/ITSLinkDef.h create mode 100644 ITS/ITSbaseLinkDef.h create mode 100644 ITS/ITSrecLinkDef.h create mode 100644 ITS/ITSsimLinkDef.h delete mode 100644 ITS/libITS.pkg create mode 100644 ITS/libITSbase.pkg create mode 100644 ITS/libITSrec.pkg create mode 100644 ITS/libITSsim.pkg diff --git a/ALIROOT/binaliroot.pkg b/ALIROOT/binaliroot.pkg index 8811fbbd70d..75d48c06e1d 100644 --- a/ALIROOT/binaliroot.pkg +++ b/ALIROOT/binaliroot.pkg @@ -7,7 +7,8 @@ ELIBSDIR:= 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 \ @@ -76,7 +77,9 @@ ARLIBS:= \ 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 \ diff --git a/DISPLAY/AliDisplayClusters.cxx b/DISPLAY/AliDisplayClusters.cxx index 85a42e9866b..fb8276cfc18 100644 --- a/DISPLAY/AliDisplayClusters.cxx +++ b/DISPLAY/AliDisplayClusters.cxx @@ -26,7 +26,6 @@ #include "AliClusters.h" #include "AliDisplay2.h" #include "AliDisplayClusters.h" -#include "AliITS.h" #include "AliITSLoader.h" #include "AliITSclusterV2.h" #include "AliITSgeom.h" @@ -91,7 +90,6 @@ void AliDisplayClusters::LoadITSClusters(Int_t nevent) return; } AliITSLoader *itsl = (AliITSLoader*)rl->GetLoader("ITSLoader"); - AliITS *its = (AliITS*)gAlice->GetModule("ITS"); rl->GetEvent(nevent); itsl->LoadRecPoints(); @@ -102,7 +100,10 @@ void AliDisplayClusters::LoadITSClusters(Int_t nevent) 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); diff --git a/HLT/ITS/AliL3ITSVertexerZ.cxx b/HLT/ITS/AliL3ITSVertexerZ.cxx index 90abaa763ed..c61ba897d29 100644 --- a/HLT/ITS/AliL3ITSVertexerZ.cxx +++ b/HLT/ITS/AliL3ITSVertexerZ.cxx @@ -41,7 +41,7 @@ AliL3ITSVertexerZ::AliL3ITSVertexerZ():AliITSVertexerZ(){ SetSecondLayerModules(); fZFound = 0; fZsig = 0.; - fITS = 0; + //fITS = 0; fZCombc = 0; fZCombf = 0; SetLowLimit(); @@ -67,20 +67,22 @@ AliESDVertex* AliL3ITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ 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); } diff --git a/ITS/AliCascadeVertex.cxx b/ITS/AliCascadeVertex.cxx index 71cdfe39515..21d252bff80 100644 --- a/ITS/AliCascadeVertex.cxx +++ b/ITS/AliCascadeVertex.cxx @@ -13,11 +13,11 @@ * 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 #include "AliCascadeVertex.h" diff --git a/ITS/AliCascadeVertex.h b/ITS/AliCascadeVertex.h index cc3e54911f5..f78ed43dbea 100644 --- a/ITS/AliCascadeVertex.h +++ b/ITS/AliCascadeVertex.h @@ -4,11 +4,11 @@ /* 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" diff --git a/ITS/AliITS.cxx b/ITS/AliITS.cxx index 6289a0a6fb8..9f1bf6f7634 100644 --- a/ITS/AliITS.cxx +++ b/ITS/AliITS.cxx @@ -65,253 +65,120 @@ the AliITS class. // /////////////////////////////////////////////////////////////////////////////// -#include #include - -#include #include #include -#include -#include -#include -#include +#include #include #include -#include #include - -#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;iAddAt(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){ @@ -330,7 +197,7 @@ 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: @@ -378,7 +245,23 @@ void AliITS::Init(){ SetDefaults(); // Array of TStrings if(gMC) for(i=0;iVolId(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. @@ -388,69 +271,16 @@ void AliITS::SetDefaults(){ // 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(){ @@ -461,164 +291,14 @@ 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 } @@ -635,24 +315,90 @@ void AliITS::MakeBranch(Option_t* option){ // 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;iGetDigitClassName(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(){ @@ -663,17 +409,25 @@ 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){ @@ -691,103 +445,57 @@ 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;indexAddAt( new AliITSmodule(index),index); - } // end for index - }else{ - fITSmodules = new TObjArray(size); - for(index=0;indexAddAt( 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; @@ -827,8 +535,8 @@ void AliITS::FillModules(TTree *treeH, Int_t mask) { for(h=0; hUncheckedAt(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!] @@ -838,123 +546,51 @@ void AliITS::FillModules(TTree *treeH, Int_t mask) { } // 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; iGetDigitClassName(); - // 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; iGetDigitClassName(); - // 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;indexAddAt( new AliITSmodule(index),index); + } // end for index + }else{ + fITSmodules = new TObjArray(size); + for(index=0;indexAddAt( new AliITSmodule(index),index); + } // end for index + + nmodules = size; + } // end i size<=0 } //______________________________________________________________________ void AliITS::Hits2SDigits(){ @@ -963,120 +599,66 @@ 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;moduleGetIndexMax();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 @@ -1095,54 +677,72 @@ void AliITS::HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size, // 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;moduleGetIndexMax();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;moduleGetIndexMax();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 @@ -1161,50 +761,269 @@ void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, // 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;moduleGetIndexMax();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;moduleGetIndexMax();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;moduleGetIndexMax();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; mGetEntriesFast(); + 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; mGetModuleId(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; iUncheckedAt(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 && labelGetMCApp()->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. @@ -1212,24 +1031,30 @@ void AliITS::ResetDigits(){ // none. // Outputs: // none. + if(!fDetTypeSim) { + Error("ResetDigits","fDetTypeSim is 0!"); + return; + } + + fDetTypeSim->ResetDigits(); - if (!fDtype) return; - Int_t i; - for (i=0;iAt(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){ @@ -1241,11 +1066,15 @@ 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. @@ -1256,11 +1085,15 @@ void AliITS::AddRealDigit(Int_t id, Int_t *digits){ // 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. @@ -1271,22 +1104,15 @@ void AliITS::AddSimDigit(Int_t id, AliITSdigit *d){ // 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: @@ -1307,33 +1133,30 @@ void AliITS::AddSimDigit(Int_t id,Float_t phys,Int_t *digits,Int_t *tracks, // 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 @@ -1359,462 +1182,14 @@ void AliITS::Digits2Raw(){ 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; iGetClassNames(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; iGetClassNames(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;moduleGetIndexMax();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<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;moduleGetIndexMax();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;iModuleGetIndexMax();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){ diff --git a/ITS/AliITS.h b/ITS/AliITS.h index ff1c3916853..46cb17200c4 100644 --- a/ITS/AliITS.h +++ b/ITS/AliITS.h @@ -9,44 +9,26 @@ // Manager class for set: ITS // //////////////////////////////////////////////////////////////////////// -//#define NEWVERSION #include // used in inline function GetModule. -#include // 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 { @@ -56,7 +38,7 @@ 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;} @@ -64,365 +46,116 @@ class AliITS : public AliDetector { // 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;iGetDigits();} + 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;iResetCluster(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 diff --git a/ITS/AliITSBeamTest.C b/ITS/AliITSBeamTest.C new file mode 100644 index 00000000000..3429ba981a1 --- /dev/null +++ b/ITS/AliITSBeamTest.C @@ -0,0 +1,58 @@ +/////////////////////////////////////////////////////// +// 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"); + +} diff --git a/ITS/AliITSBeamTestDig.cxx b/ITS/AliITSBeamTestDig.cxx index e8bb21d630c..4cd85f02e06 100644 --- a/ITS/AliITSBeamTestDig.cxx +++ b/ITS/AliITSBeamTestDig.cxx @@ -19,8 +19,8 @@ ClassImp(AliITSBeamTestDig) // fReader=0; fTreeD=0; - fBt=0; fITSHeader=0; + fITSgeom=0; } //_____________________________________________________________ @@ -32,9 +32,8 @@ ClassImp(AliITSBeamTestDig) fReader=0; fTreeD=0; - fBt=0; fITSHeader=0; - + fITSgeom = 0; } //______________________________________________________________________ @@ -43,8 +42,8 @@ AliITSBeamTestDig::AliITSBeamTestDig(const AliITSBeamTestDig &bt):TTask(bt){ fReader=bt.fReader; fTreeD=bt.fTreeD; - fBt=bt.fBt; fITSHeader=bt.fITSHeader; + fITSgeom = bt.fITSgeom; } //______________________________________________________________________ AliITSBeamTestDig& AliITSBeamTestDig::operator=(const AliITSBeamTestDig &source){ diff --git a/ITS/AliITSBeamTestDig.h b/ITS/AliITSBeamTestDig.h index 95760f78c71..4c39fa328f9 100644 --- a/ITS/AliITSBeamTestDig.h +++ b/ITS/AliITSBeamTestDig.h @@ -10,10 +10,11 @@ #include "TTask.h" -class AliITS; + class AliRawReader; class TTree; class AliITSEventHeader; +class AliITSgeom; class AliITSBeamTestDig: public TTask { @@ -29,8 +30,7 @@ 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: @@ -38,10 +38,10 @@ class AliITSBeamTestDig: public TTask { 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 }; diff --git a/ITS/AliITSBeamTestDigSDD.cxx b/ITS/AliITSBeamTestDigSDD.cxx index 72c0e352f74..4bd8c180b7a 100644 --- a/ITS/AliITSBeamTestDigSDD.cxx +++ b/ITS/AliITSBeamTestDigSDD.cxx @@ -5,7 +5,6 @@ // // // // //////////////////////////////////////////////////// -#include "AliITS.h" #include "AliITSdigitSDD.h" #include "AliRawReader.h" #include "AliVMERawStream.h" @@ -63,17 +62,22 @@ void AliITSBeamTestDigSDD::Exec(Option_t* /*opt*/) 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++; } } } diff --git a/ITS/AliITSBeamTestDigSPD.cxx b/ITS/AliITSBeamTestDigSPD.cxx index 28d006058b2..d0da3f9a472 100644 --- a/ITS/AliITSBeamTestDigSPD.cxx +++ b/ITS/AliITSBeamTestDigSPD.cxx @@ -6,7 +6,6 @@ // // //////////////////////////////////////////////////// -#include "AliITS.h" #include "AliITSdigitSPD.h" #include "AliRawReader.h" #include "AliRawReader.h" @@ -57,19 +56,22 @@ void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/) //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++; } } } diff --git a/ITS/AliITSBeamTestDigSSD.cxx b/ITS/AliITSBeamTestDigSSD.cxx index 2999101c975..b2fcd87a6ae 100644 --- a/ITS/AliITSBeamTestDigSSD.cxx +++ b/ITS/AliITSBeamTestDigSSD.cxx @@ -5,7 +5,6 @@ // Date: October 2004 // //////////////////////////////////////// -#include "AliITS.h" #include "AliITSgeom.h" #include "AliITSdigitSSD.h" #include "AliRawReader.h" @@ -43,17 +42,21 @@ void AliITSBeamTestDigSSD::Exec(Option_t* /*opt*/) { //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++; } } } diff --git a/ITS/AliITSBeamTestDigitizer.cxx b/ITS/AliITSBeamTestDigitizer.cxx index 0c0373ee4d3..d0484fc365a 100644 --- a/ITS/AliITSBeamTestDigitizer.cxx +++ b/ITS/AliITSBeamTestDigitizer.cxx @@ -3,6 +3,8 @@ // 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 // //////////////////////////////////////////////////// @@ -11,20 +13,12 @@ #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 -//#include const TString AliITSBeamTestDigitizer::fgkDefaultDigitsFileName="ITS.Digits.root"; @@ -46,19 +40,17 @@ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer():TTask() 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; @@ -71,11 +63,11 @@ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer():TTask() 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) { // @@ -83,7 +75,6 @@ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer():TTask() // fRunLoader=0; fLoader=0; - fBt=0; fEvIn=0; fEvFin=0; fDATEEvType=7; @@ -96,71 +87,19 @@ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer():TTask() 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); @@ -173,20 +112,18 @@ void AliITSBeamTestDigitizer::Init(){ 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. @@ -213,7 +150,7 @@ AliITSBeamTestDigitizer& AliITSBeamTestDigitizer::operator=(const AliITSBeamTest AliITSBeamTestDigitizer::~AliITSBeamTestDigitizer(){ //Destructor - if(fBt) delete fBt; + // if(fBt) delete fBt; if(fLoader) delete fLoader; if(fHeader) delete fHeader; } @@ -247,7 +184,6 @@ void AliITSBeamTestDigitizer::ExecDigitization(){ else rd = new AliRawReaderRoot(fRawdataFileName,fEvIn); AliHeader* header = fRunLoader->GetHeader(); - Int_t iev=fEvIn-1; @@ -291,9 +227,11 @@ void AliITSBeamTestDigitizer::ExecDigitization(){ 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); diff --git a/ITS/AliITSBeamTestDigitizer.h b/ITS/AliITSBeamTestDigitizer.h index a07db7e2de9..e235a0a00f9 100644 --- a/ITS/AliITSBeamTestDigitizer.h +++ b/ITS/AliITSBeamTestDigitizer.h @@ -23,7 +23,6 @@ class AliITSBeamTestDigSDD; class AliRawReaderDate; class AliRunLoader; class AliITSLoader; -class AliITS; class AliITSEventHeader; class AliRawDataHeader; @@ -34,10 +33,9 @@ class AliITSBeamTestDigitizer : public TTask { 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); @@ -56,18 +54,16 @@ class AliITSBeamTestDigitizer : public TTask { 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: @@ -86,8 +82,6 @@ class AliITSBeamTestDigitizer : public TTask { 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 @@ -95,7 +89,7 @@ class AliITSBeamTestDigitizer : public TTask { 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 }; diff --git a/ITS/AliITSClusterFinder.cxx b/ITS/AliITSClusterFinder.cxx index 152b98cc72a..4d5cfb55c3a 100644 --- a/ITS/AliITSClusterFinder.cxx +++ b/ITS/AliITSClusterFinder.cxx @@ -21,17 +21,11 @@ //////////////////////////////////////////////////////////////////////////// #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) @@ -58,7 +52,6 @@ fNPeaks(-1){ // none. // Return: // A default constructed AliITSCulsterFinder - Init(); } //---------------------------------------------------------------------- AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg, @@ -89,7 +82,6 @@ fNPeaks(-1){ SetNperMax(); SetClusterSize(); SetDeclusterFlag(); - Init(); } //---------------------------------------------------------------------- AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg, @@ -123,7 +115,6 @@ fNPeaks(-1){ SetNperMax(); SetClusterSize(); SetDeclusterFlag(); - Init(); } //______________________________________________________________________ AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source) : TObject(source) { @@ -162,37 +153,40 @@ AliITSClusterFinder::~AliITSClusterFinder(){ 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; mGetModuleId(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 @@ -204,8 +198,12 @@ void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c){ // 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, @@ -219,12 +217,17 @@ 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]) { //------------------------------------------------------------ @@ -255,7 +258,7 @@ void AliITSClusterFinder::CheckLabels(Int_t lab[3]) { } } - +*/ //______________________________________________________________________ void AliITSClusterFinder::FindRawClusters(Int_t module){ // Default Cluster finder. @@ -397,7 +400,7 @@ Bool_t AliITSClusterFinder::IsNeighbor(TObjArray *digs,Int_t i,Int_t n[])const{ } //______________________________________________________________________ -void AliITSClusterFinder::Print(ostream *os){ +void AliITSClusterFinder::Print(ostream *os) const{ //Standard output format for this class // Inputs: // ostream *os Output stream @@ -415,6 +418,7 @@ void AliITSClusterFinder::Print(ostream *os){ *os << fClusterSize<<","; *os << fNPeaks< 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=level;} + + void SetITSgeom(AliITSgeom* geom) {fITSgeom=geom;} + AliITSgeom* GetITSgeom() const {return fITSgeom;} // // Setters and Getters // segmentation @@ -114,19 +118,18 @@ class AliITSClusterFinder :public TObject{ //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); @@ -143,7 +146,6 @@ class AliITSClusterFinder :public TObject{ // 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 @@ -153,8 +155,10 @@ class AliITSClusterFinder :public TObject{ 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); diff --git a/ITS/AliITSClusterFinderSDD.cxx b/ITS/AliITSClusterFinderSDD.cxx index 3140baf2490..bbb2ece98bf 100644 --- a/ITS/AliITSClusterFinderSDD.cxx +++ b/ITS/AliITSClusterFinderSDD.cxx @@ -20,21 +20,17 @@ // for Silicon // // Drift Detector // ////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#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) @@ -233,7 +229,7 @@ void AliITSClusterFinderSDD::Find1DClusters(){ 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++; @@ -326,7 +322,7 @@ void AliITSClusterFinderSDD::Find1DClustersE(){ 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 @@ -835,7 +831,7 @@ void AliITSClusterFinderSDD::ResolveClusters(){ 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; @@ -961,7 +957,7 @@ void AliITSClusterFinderSDD::GetRecPoints(){ 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(); } diff --git a/ITS/AliITSClusterFinderSPD.cxx b/ITS/AliITSClusterFinderSPD.cxx index 33e580fa870..bcaf35d7a4d 100644 --- a/ITS/AliITSClusterFinderSPD.cxx +++ b/ITS/AliITSClusterFinderSPD.cxx @@ -18,15 +18,13 @@ // // //////////////////////////////////////////////////////////////////////////// -#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 @@ -383,7 +381,7 @@ void AliITSClusterFinderSPD::ClusterFinder(Int_t ndigits,Int_t digx[], (Double_t) ndzmin, (Double_t) ndzmax, 0,GetModule()); - fITS->AddCluster(0,clust); + fDetTypeRec->AddCluster(0,clust); delete clust; }//end loop on clusters delete[] ifpad; @@ -428,6 +426,6 @@ void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus, rnew.fTracks[0]=tr1clus[i]; rnew.fTracks[1]=tr2clus[i]; rnew.fTracks[2]=tr3clus[i]; - fITS->AddRecPoint(rnew); + fDetTypeRec->AddRecPoint(rnew); } // end for i } diff --git a/ITS/AliITSClusterFinderSSD.cxx b/ITS/AliITSClusterFinderSSD.cxx index 28c81397226..70d59c0d388 100644 --- a/ITS/AliITSClusterFinderSSD.cxx +++ b/ITS/AliITSClusterFinderSSD.cxx @@ -19,11 +19,10 @@ // **************************************************************************// /////////////////////////////////////////////////////////////////////////////// -#include #include -#include "AliITS.h" #include "AliITSClusterFinderSSD.h" +#include "AliITSDetTypeRec.h" #include "AliITSMapA1.h" #include "AliITSRawClusterSSD.h" #include "AliITSRecPoint.h" @@ -31,10 +30,8 @@ #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; @@ -190,22 +187,26 @@ void AliITSClusterFinderSSD::FindRawClusters(Int_t module){ // 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(){ @@ -647,7 +648,7 @@ Bool_t AliITSClusterFinderSSD::CreateNewRecPoint(Double_t P,Double_t dP, 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); @@ -658,8 +659,9 @@ Bool_t AliITSClusterFinderSSD::CreateNewRecPoint(Double_t P,Double_t dP, 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; } diff --git a/ITS/AliITSClusterFinderV2.cxx b/ITS/AliITSClusterFinderV2.cxx index 4e4c5861102..d1c0081dd23 100644 --- a/ITS/AliITSClusterFinderV2.cxx +++ b/ITS/AliITSClusterFinderV2.cxx @@ -22,10 +22,7 @@ #include "AliRun.h" #include "AliITSClusterFinderV2.h" -#include "AliITSRecPoint.h" #include "AliITSclusterV2.h" -#include "AliITSsimulationFastPoints.h" -#include "AliITS.h" #include "AliITSgeom.h" #include #include "AliMC.h" @@ -34,15 +31,13 @@ ClassImp(AliITSClusterFinderV2) 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(); } //______________________________________________________________________ @@ -252,45 +247,3 @@ MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSclusterV2 &c) { 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; mGetModule(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; -} - diff --git a/ITS/AliITSClusterFinderV2.h b/ITS/AliITSClusterFinderV2.h index 653f911efe9..04602a9b5e8 100644 --- a/ITS/AliITSClusterFinderV2.h +++ b/ITS/AliITSClusterFinderV2.h @@ -9,24 +9,19 @@ //////////////////////////////////////////////////////////////////// #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: diff --git a/ITS/AliITSClusterFinderV2SDD.cxx b/ITS/AliITSClusterFinderV2SDD.cxx index b87e0a24cdb..9bc7e4ea465 100644 --- a/ITS/AliITSClusterFinderV2SDD.cxx +++ b/ITS/AliITSClusterFinderV2SDD.cxx @@ -20,23 +20,21 @@ /////////////////////////////////////////////////////////////////////////// -#include "AliRun.h" #include "AliITSClusterFinderV2SDD.h" #include "AliITSclusterV2.h" +#include "AliITSDetTypeRec.h" #include "AliRawReader.h" #include "AliITSRawStreamSDD.h" #include -#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 @@ -246,7 +244,7 @@ FindClustersSDD(AliBin* bins[2], Int_t nMaxBin, Int_t nzBins, } if(clusters) new (cl[ncl]) AliITSclusterV2(c); else { - fITS->AddClusterV2(c); + fDetTypeRec->AddClusterV2(c); } ncl++; } diff --git a/ITS/AliITSClusterFinderV2SDD.h b/ITS/AliITSClusterFinderV2SDD.h index 0379928b6ac..405e83b9efd 100644 --- a/ITS/AliITSClusterFinderV2SDD.h +++ b/ITS/AliITSClusterFinderV2SDD.h @@ -17,7 +17,7 @@ class AliITSRawStream; class AliITSClusterFinderV2SDD : public AliITSClusterFinderV2 { public: - AliITSClusterFinderV2SDD(); + AliITSClusterFinderV2SDD(AliITSgeom* geom); virtual ~AliITSClusterFinderV2SDD(){;} virtual void FindRawClusters(Int_t mod); virtual void RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters); diff --git a/ITS/AliITSClusterFinderV2SPD.cxx b/ITS/AliITSClusterFinderV2SPD.cxx index 476a36fbc22..cda2cda345c 100644 --- a/ITS/AliITSClusterFinderV2SPD.cxx +++ b/ITS/AliITSClusterFinderV2SPD.cxx @@ -19,15 +19,14 @@ // // /////////////////////////////////////////////////////////////////////////// -#include "AliRun.h" #include "AliITSClusterFinderV2SPD.h" #include "AliITSclusterV2.h" +#include "AliITSDetTypeRec.h" #include "AliRawReader.h" #include "AliITSRawStreamSPD.h" #include -#include "AliITS.h" #include "AliITSgeom.h" #include "AliITSdigitSPD.h" @@ -35,13 +34,13 @@ ClassImp(AliITSClusterFinderV2SPD) 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; @@ -201,7 +200,7 @@ Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,T 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]}; diff --git a/ITS/AliITSClusterFinderV2SPD.h b/ITS/AliITSClusterFinderV2SPD.h index 7f6ee33ef9e..fb0083e13ef 100644 --- a/ITS/AliITSClusterFinderV2SPD.h +++ b/ITS/AliITSClusterFinderV2SPD.h @@ -14,10 +14,11 @@ 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); diff --git a/ITS/AliITSClusterFinderV2SSD.cxx b/ITS/AliITSClusterFinderV2SSD.cxx index 94e20f949f7..44e54ee81a9 100644 --- a/ITS/AliITSClusterFinderV2SSD.cxx +++ b/ITS/AliITSClusterFinderV2SSD.cxx @@ -19,28 +19,26 @@ // // /////////////////////////////////////////////////////////////////////////// -#include "AliRun.h" #include "AliITSClusterFinderV2SSD.h" #include "AliITSclusterV2.h" +#include "AliITSDetTypeRec.h" #include "AliRawReader.h" #include "AliITSRawStreamSSD.h" #include -#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; @@ -417,7 +415,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, 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); @@ -474,7 +472,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, 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); @@ -518,7 +516,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, 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); @@ -580,7 +578,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, 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); @@ -622,7 +620,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info); else{ cl2 = new AliITSclusterV2(milab,lp,info); - fITS->AddClusterV2(*cl2); + fDetTypeRec->AddClusterV2(*cl2); } ncl++; @@ -712,7 +710,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info); else{ cl2 = new AliITSclusterV2(milab,lp,info); - fITS->AddClusterV2(*cl2); + fDetTypeRec->AddClusterV2(*cl2); } @@ -769,7 +767,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, 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); diff --git a/ITS/AliITSClusterFinderV2SSD.h b/ITS/AliITSClusterFinderV2SSD.h index 179edd9c3d7..670fbe42fdc 100644 --- a/ITS/AliITSClusterFinderV2SSD.h +++ b/ITS/AliITSClusterFinderV2SSD.h @@ -17,7 +17,7 @@ class AliITSRawStream; class AliITSClusterFinderV2SSD : public AliITSClusterFinderV2 { public: - AliITSClusterFinderV2SSD(); + AliITSClusterFinderV2SSD(AliITSgeom* geom); virtual ~AliITSClusterFinderV2SSD(){;} virtual void FindRawClusters(Int_t mod); virtual void RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters); diff --git a/ITS/AliITSDDLRawData.C b/ITS/AliITSDDLRawData.C index db50773adba..e7dbe274df3 100644 --- a/ITS/AliITSDDLRawData.C +++ b/ITS/AliITSDDLRawData.C @@ -23,6 +23,7 @@ void AliITSDDLRawData(Int_t eventNumber=0){ 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){ @@ -43,7 +44,7 @@ void AliITSDDLRawData(Int_t eventNumber=0){ Int_t nmodules; ITS->InitModules(-1,nmodules); - ITS->SetTreeAddressD(TD); + ITS->GetDetTypeSim()->SetTreeAddressD(TD,"ITS"); AliITSDDLRawData *util=new AliITSDDLRawData(); //Verbose level diff --git a/ITS/AliITSDDLRawData.cxx b/ITS/AliITSDDLRawData.cxx index fdfdd516c29..6107ca467f7 100644 --- a/ITS/AliITSDDLRawData.cxx +++ b/ITS/AliITSDDLRawData.cxx @@ -23,15 +23,9 @@ //SSD #include -#include #include #include -#include -#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" diff --git a/ITS/AliITSDDLRawData.h b/ITS/AliITSDDLRawData.h index 4255428f618..f4f766a47fc 100644 --- a/ITS/AliITSDDLRawData.h +++ b/ITS/AliITSDDLRawData.h @@ -8,7 +8,6 @@ #ifndef AliITSDDLRAWDATA_H #define AliITSDDLRAWDATA_H -class AliITS; class TTree; class AliITSDDLRawData:public TObject{ diff --git a/ITS/AliITSDetType.cxx b/ITS/AliITSDetType.cxx deleted file mode 100644 index 3d80fa8ae41..00000000000 --- a/ITS/AliITSDetType.cxx +++ /dev/null @@ -1,133 +0,0 @@ -/************************************************************************** - * 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; -} diff --git a/ITS/AliITSDetType.h b/ITS/AliITSDetType.h deleted file mode 100644 index 30768c7fe8b..00000000000 --- a/ITS/AliITSDetType.h +++ /dev/null @@ -1,110 +0,0 @@ -#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 -#include - -#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 diff --git a/ITS/AliITSDetTypeRec.cxx b/ITS/AliITSDetTypeRec.cxx index acd08192826..e6915d63fbe 100644 --- a/ITS/AliITSDetTypeRec.cxx +++ b/ITS/AliITSDetTypeRec.cxx @@ -17,15 +17,42 @@ $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] @@ -33,7 +60,6 @@ fSegmentation(), // [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. @@ -45,15 +71,804 @@ fRecPointClassName(){// String with RecPoint 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;iDelete(); + 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; iAt(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;dettypeSetAngles(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;imodGetIndexMax();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;imodGetIndexMax();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;imodGetIndexMax();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;iAddAt(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;iAt(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;iAt(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;iAt(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;moduleGetIndexMax();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;iModuleGetIndexMax();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); + +} + diff --git a/ITS/AliITSDetTypeRec.h b/ITS/AliITSDetTypeRec.h index f6d028146d5..55349700940 100644 --- a/ITS/AliITSDetTypeRec.h +++ b/ITS/AliITSDetTypeRec.h @@ -7,38 +7,129 @@ $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 #include #include -#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 diff --git a/ITS/AliITSDetTypeSim.cxx b/ITS/AliITSDetTypeSim.cxx index 4cba23fe49a..d6c4993d624 100644 --- a/ITS/AliITSDetTypeSim.cxx +++ b/ITS/AliITSDetTypeSim.cxx @@ -17,11 +17,37 @@ $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) @@ -34,9 +60,6 @@ fSegmentation(), // [NDet] 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 @@ -51,6 +74,17 @@ fDigClassName(){ // String with digit class name. // 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(){ @@ -61,156 +95,499 @@ 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;iGetSize();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;iGetSize();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;iGetSize();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;indexAddAt( 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;iGetEntries();i++){ + if(fResponse->At(i)) delete (AliITSresponse*)fResponse->At(i); + } + } +} +//______________________________________________________________________ +void AliITSDetTypeSim::ResetSegmentation(){ + + //Resets segmentation array + if(fSegmentation){ + for(Int_t i=0;iAt(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;imodGetIndexMax();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;idetGetStartSPD()); + 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;iAt(i))){ + fDigits->AddAt(new TClonesArray(classn.Data(),1000),i); }else{ - fHitModule = new TObjArray(size); - for(index=0;indexAddAt( 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;iAt(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;moduleGetIndexMax();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; iPrimTrackGetEvent(iPrimTrack); - if (nBytes <= 0) continue; - Int_t nHits = fHits->GetEntriesFast(); - for(h=0; hUncheckedAt(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; + } } diff --git a/ITS/AliITSDetTypeSim.h b/ITS/AliITSDetTypeSim.h index b4c8762ecfc..8125d624f10 100644 --- a/ITS/AliITSDetTypeSim.h +++ b/ITS/AliITSDetTypeSim.h @@ -7,109 +7,98 @@ $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 #include #include -#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 diff --git a/ITS/AliITSDigitPlot.C b/ITS/AliITSDigitPlot.C index 9a87401b0e6..0b184161056 100644 --- a/ITS/AliITSDigitPlot.C +++ b/ITS/AliITSDigitPlot.C @@ -135,9 +135,10 @@ void AliITSDigitPlot(Int_t istart=0,Int_t iend=-1, 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 diff --git a/ITS/AliITSDigitizer.cxx b/ITS/AliITSDigitizer.cxx index dee5737d0c7..d38f746e37b 100644 --- a/ITS/AliITSDigitizer.cxx +++ b/ITS/AliITSDigitizer.cxx @@ -14,18 +14,18 @@ **************************************************************************/ /* $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 -#include #include #include #include @@ -35,10 +35,8 @@ #include #include #include "AliITSDigitizer.h" -#include "AliITSpList.h" #include "AliITSgeom.h" #include "AliITSsimulation.h" -#include "AliITSDetType.h" ClassImp(AliITSDigitizer) @@ -76,6 +74,22 @@ AliITSDigitizer::AliITSDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr){ 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. @@ -144,21 +158,18 @@ void AliITSDigitizer::Exec(Option_t* opt){ 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]; @@ -192,6 +203,7 @@ void AliITSDigitizer::Exec(Option_t* opt){ Error("Exec","Can not get Output ITS Loader"); return; } + outgime->LoadDigits("update"); if (outgime->TreeD() == 0x0) outgime->MakeTree("D"); @@ -212,18 +224,15 @@ void AliITSDigitizer::Exec(Option_t* opt){ for(module=0; moduleGetITSgeom()->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; ifilesDigits - 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; ifilesGetInputFolderName(fl[ifiles])); @@ -280,6 +288,8 @@ void AliITSDigitizer::Exec(Option_t* opt){ sdig->Clear(); delete sdig; for(Int_t i=0;iGetITSgeom()->GetIndexMax();i++) fModActive[i] = kTRUE; + + return; } //______________________________________________________________________ diff --git a/ITS/AliITSDigitizer.h b/ITS/AliITSDigitizer.h index b5ed7c83423..ec370cdc5ad 100644 --- a/ITS/AliITSDigitizer.h +++ b/ITS/AliITSDigitizer.h @@ -1,12 +1,14 @@ -#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; @@ -20,6 +22,9 @@ class AliITSDigitizer : public AliDigitizer{ public: AliITSDigitizer(); AliITSDigitizer(AliRunDigitizer *manager); + AliITSDigitizer(const AliITSDigitizer& dig); + AliITSDigitizer& operator=(const AliITSDigitizer &source); + virtual ~AliITSDigitizer(); // Standard routines. virtual Bool_t Init(); diff --git a/ITS/AliITSEventHeader.cxx b/ITS/AliITSEventHeader.cxx index c91021520c7..6168accf9d5 100644 --- a/ITS/AliITSEventHeader.cxx +++ b/ITS/AliITSEventHeader.cxx @@ -1,13 +1,12 @@ +#include "AliITSEventHeader.h" //////////////////////////////////////////////////// // Base class to define // // ITS Event Header // -// +// // // Origin: E. Crescio crescio@to.infn.it // // // //////////////////////////////////////////////////// -#include "AliITSEventHeader.h" - ClassImp(AliITSEventHeader) diff --git a/ITS/AliITSFDigitizer.cxx b/ITS/AliITSFDigitizer.cxx index 26cf0108301..47d376cf620 100644 --- a/ITS/AliITSFDigitizer.cxx +++ b/ITS/AliITSFDigitizer.cxx @@ -15,13 +15,14 @@ /* $Id$ */ +////////////////////////////////////////////////////////////////// +// Class for fast reconstruction of recpoints // +// // +// // +////////////////////////////////////////////////////////////////// + #include -#include -#include -#include #include -#include -#include #include #include @@ -29,8 +30,6 @@ #include #include "AliITSFDigitizer.h" -// #include "AliITSpList.h" -#include "AliITSmodule.h" #include "AliITSgeom.h" #include "AliITSsimulationFastPoints.h" @@ -52,6 +51,22 @@ AliITSFDigitizer::AliITSFDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr){ 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(){ // @@ -115,10 +130,11 @@ void AliITSFDigitizer::Exec(Option_t* opt){ 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); @@ -147,10 +163,9 @@ void AliITSFDigitizer::Exec(Option_t* opt){ AliITSgeom *geom = fITS->GetITSgeom(); for(Int_t moduleIndex = 0; moduleIndexGetIndexMax(); moduleIndex++){ - sim->CreateFastRecPoints(moduleIndex); -// branch->Fill(); + sim->CreateFastRecPoints(moduleIndex,recPoints); outputTreeR->Fill(); - fITS->ResetRecPoints(); + recPoints->Clear(); } outrl->WriteRecPoints("OVERWRITE"); // outputTreeR->AutoSave(); diff --git a/ITS/AliITSFDigitizer.h b/ITS/AliITSFDigitizer.h index 3f92cdedd28..254a46cbdf0 100644 --- a/ITS/AliITSFDigitizer.h +++ b/ITS/AliITSFDigitizer.h @@ -1,16 +1,17 @@ -#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 // function of this class used in inline functions. class AliRunDigitizer; @@ -22,6 +23,8 @@ class AliITSFDigitizer : public AliDigitizer{ public: AliITSFDigitizer(); AliITSFDigitizer(AliRunDigitizer *manager); + AliITSFDigitizer(const AliITSFDigitizer& rec); + AliITSFDigitizer& operator=(const AliITSFDigitizer &source); virtual ~AliITSFDigitizer(); // Standard routines. virtual Bool_t Init(); diff --git a/ITS/AliITSFindClustersV2.C b/ITS/AliITSFindClustersV2.C index 82808a0539e..d9728602dd3 100644 --- a/ITS/AliITSFindClustersV2.C +++ b/ITS/AliITSFindClustersV2.C @@ -57,40 +57,50 @@ Int_t AliITSFindClustersV2(Int_t nev=5, Char_t SlowOrFast='s') { 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; irl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents(); + for (Int_t i=0; iGetEvent(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; iGetEvent(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; diff --git a/ITS/AliITSFindClustersV2.cxx b/ITS/AliITSFindClustersV2.cxx index 15e3710dbf6..695cc148d21 100644 --- a/ITS/AliITSFindClustersV2.cxx +++ b/ITS/AliITSFindClustersV2.cxx @@ -14,8 +14,12 @@ **************************************************************************/ /* $Id$ */ +/////////////////////////////////////////////////////////////////// +//Class for reconstruction of clusters V2 // +// // +// // +/////////////////////////////////////////////////////////////////// -#include #include #include #include @@ -25,7 +29,6 @@ #include "AliRun.h" #include "AliHeader.h" -#include "AliITS.h" #include "AliITSRecPoint.h" #include "AliITSFindClustersV2.h" #include "AliITSclusterV2.h" @@ -98,7 +101,7 @@ AliITSFindClustersV2::AliITSFindClustersV2(const TString infile, return; } // end if !fAr fDeletfAr = kTRUE; // Since gAlice was read in, delete it. - + /* AliITS *its = (AliITS*) fAr->GetModule("ITS"); if(!its){ Warning("AliITSFindClusterV2", @@ -111,6 +114,16 @@ AliITSFindClustersV2::AliITSFindClustersV2(const TString infile, "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; @@ -149,6 +162,7 @@ AliITSFindClustersV2::AliITSFindClustersV2(TFile *in, return; } // end if !fAr fDeletfAr = kTRUE; // Since gAlice was read in, delete it. + /* AliITS *its = (AliITS*) fAr->GetModule("ITS"); if(!its){ Warning("AliITSFindClusterV2", @@ -156,12 +170,17 @@ AliITSFindClustersV2::AliITSFindClustersV2(TFile *in, 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; } @@ -204,22 +223,43 @@ AliITSFindClustersV2::AliITSFindClustersV2(AliRun *ar, "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. diff --git a/ITS/AliITSFindClustersV2.h b/ITS/AliITSFindClustersV2.h index 90f35005dc8..fb1c62fdb9e 100644 --- a/ITS/AliITSFindClustersV2.h +++ b/ITS/AliITSFindClustersV2.h @@ -6,7 +6,9 @@ /* $Id$ */ - +/////////////////////////////////////////////////////////////////// +//Class for reconstruction of clusters V2 // +/////////////////////////////////////////////////////////////////// #include class TString; @@ -23,6 +25,9 @@ class AliITSFindClustersV2 : public TTask{ 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;} diff --git a/ITS/AliITSGeant3Geometry.cxx b/ITS/AliITSGeant3Geometry.cxx index cdaeeb46f15..5d5389e8acb 100644 --- a/ITS/AliITSGeant3Geometry.cxx +++ b/ITS/AliITSGeant3Geometry.cxx @@ -15,14 +15,15 @@ /* $Id$ */ -/* - * Version: 0 - * Written by Bjorn S. Nilsen with code stolen from Andreas Morsch's - * AliGeant3GeometryGUI class. - */ #include #include "AliITSGeant3Geometry.h" +///////////////////////////////////////////////////////////////////////// +// Version: 0 // +// Written by Bjorn S. Nilsen with code stolen from Andreas Morsch's // +// AliGeant3GeometryGUI class. // +// // +///////////////////////////////////////////////////////////////////////// ClassImp(AliITSGeant3Geometry) diff --git a/ITS/AliITSGeant3Geometry.h b/ITS/AliITSGeant3Geometry.h index 0a89c24cc4d..5d05d381399 100644 --- a/ITS/AliITSGeant3Geometry.h +++ b/ITS/AliITSGeant3Geometry.h @@ -4,6 +4,11 @@ * 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" diff --git a/ITS/AliITSGeoPlot.C b/ITS/AliITSGeoPlot.C index 0bd6faa1505..45f6c19893f 100644 --- a/ITS/AliITSGeoPlot.C +++ b/ITS/AliITSGeoPlot.C @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -37,7 +37,7 @@ Int_t GetRecCoor(TObject *ge, TClonesArray *ITSrec, Int_t mod, TH2F *h2, TH1F *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. @@ -159,13 +159,18 @@ Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+Rec", char *filename="galice cout<<"Filling modules... It takes a while, now. Please be patient"<FillModules(0,0,nmodules," "," "); cout<<"ITS modules .... DONE!"<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){ @@ -184,10 +189,9 @@ Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+Rec", char *filename="galice 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)){ @@ -315,11 +319,10 @@ Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+Rec", char *filename="galice 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); @@ -350,23 +353,24 @@ Int_t AliITSGeoPlot (Int_t evesel=0, char *opt="All+Rec", char *filename="galice //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); } @@ -480,6 +484,7 @@ void GetHitsCoor(TObject *its, Int_t mod, TObjArray & histos, Int_t subd,Bool_t 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){ @@ -516,6 +521,7 @@ Int_t GetClusCoor(TObject *ge, TClonesArray *ITSrec, Int_t mod, TH2F *h2, TH1F * } h2->Fill(gc[0],gc[1]); h1->Fill(gc[2]); + } } return nrecp; diff --git a/ITS/AliITSIOTrack.h b/ITS/AliITSIOTrack.h index 1986a4f40b5..f298c2a9a9a 100644 --- a/ITS/AliITSIOTrack.h +++ b/ITS/AliITSIOTrack.h @@ -39,8 +39,8 @@ class AliITSIOTrack : public TObject { 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 diff --git a/ITS/AliITSLoader.cxx b/ITS/AliITSLoader.cxx index 92e5979d0e9..8b6aef63363 100644 --- a/ITS/AliITSLoader.cxx +++ b/ITS/AliITSLoader.cxx @@ -1,9 +1,6 @@ -#include "AliITS.h" -#include "AliITSgeom.h" #include "AliITSdigit.h" -#include "AliRun.h" -#include "AliDetector.h" #include "AliITSLoader.h" +#include "AliRunLoader.h" /////////////////////////////////////////////////////////////////////////// // Loader for ITS @@ -17,7 +14,6 @@ const TString AliITSLoader::fgkDefaultBackTracksContainerName = "TreeB"; const TString AliITSLoader::fgkDefaultVerticesContainerName = "Vertex"; const TString AliITSLoader::fgkDefaultV0ContainerName = "V0"; const TString AliITSLoader::fgkDefaultCascadeContainerName = "Cascade"; - ClassImp(AliITSLoader) /**********************************************************************/ @@ -124,6 +120,7 @@ AliITSLoader::~AliITSLoader(){ dl = GetCascadeDataLoader(); fDataLoaders->Remove(dl); } +/* //---------------------------------------------------------------------- AliITS* AliITSLoader::GetITS(){ // Returns the pointer to the ITS, kept on the file. A short cut metthod @@ -161,6 +158,7 @@ void AliITSLoader::SetupDigits(AliITS *its){ its->SetTreeAddressD(TreeD()); } +*/ //---------------------------------------------------------------------- void AliITSLoader::SetupDigits(TObjArray *digPerDet,Int_t n, const Char_t **digclass){ @@ -244,6 +242,7 @@ AliITSdigit * AliITSLoader::GetDigit(TObjArray *digPerDet,Int_t module, } // 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. @@ -270,6 +269,7 @@ AliITSdigit * AliITSLoader::GetDigit(AliITS *its,Int_t module,Int_t digit){ } // end if return 0; } +*/ //---------------------------------------------------------------------- void AliITSLoader::MakeTree(Option_t *opt){ // invokes AliLoader::MakeTree + specific ITS tree(s) @@ -287,3 +287,24 @@ void AliITSLoader::MakeTree(Option_t *opt){ 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; +} + diff --git a/ITS/AliITSLoader.h b/ITS/AliITSLoader.h index ebba0445e9e..93c0282e478 100644 --- a/ITS/AliITSLoader.h +++ b/ITS/AliITSLoader.h @@ -1,10 +1,12 @@ #ifndef ALIITSLOADER_H #define ALIITSLOADER_H - +////////////////////////////////////////////////////////// +// Loader class for ITS // +////////////////////////////////////////////////////////// #include #include +#include -class AliITS; class AliITSdigit; class TObjArray; @@ -17,16 +19,12 @@ class AliITSLoader: public AliLoader{ 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); @@ -66,7 +64,6 @@ class AliITSLoader: public AliLoader{ AliESDVertex *GetVertex(){ return static_cast (GetVertexDataLoader()-> GetBaseLoader(0)->Get());} - //V0s AliDataLoader* GetV0DataLoader() {return GetDataLoader("V0 Vertices");} virtual void CleanV0s() {GetV0DataLoader()->GetBaseLoader(0)->Clean();} @@ -109,6 +106,8 @@ class AliITSLoader: public AliLoader{ virtual Int_t WriteBackTracks(Option_t* opt=""){ return GetBackTracksDataLoader()->GetBaseLoader(0)->WriteData(opt);} + // Geometry + AliITSgeom* GetITSgeom(); protected: // METHODS diff --git a/ITS/AliITSMapA1.cxx b/ITS/AliITSMapA1.cxx index 787d5759646..29ebbac592e 100644 --- a/ITS/AliITSMapA1.cxx +++ b/ITS/AliITSMapA1.cxx @@ -13,11 +13,8 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ #include -#include - #include "AliITSMapA1.h" #include "AliITSsegmentation.h" -#include "AliITSresponse.h" #include "AliITSdigit.h" //////////////////////////////////////////////////////////////////////// @@ -199,7 +196,7 @@ Double_t AliITSMapA1::GetSignal(Int_t iz, Int_t ix){ 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; diff --git a/ITS/AliITSMapA2.cxx b/ITS/AliITSMapA2.cxx index 74f6e4ad513..c18b17bbce2 100644 --- a/ITS/AliITSMapA2.cxx +++ b/ITS/AliITSMapA2.cxx @@ -15,11 +15,9 @@ #include #include -#include #include "AliITSMapA2.h" #include "AliITSsegmentation.h" -#include "AliITSresponse.h" #include "AliITSdigit.h" //////////////////////////////////////////////////////////////////////// diff --git a/ITS/AliITSNeuralPoint.cxx b/ITS/AliITSNeuralPoint.cxx index 6e1d0345e51..31762f96546 100644 --- a/ITS/AliITSNeuralPoint.cxx +++ b/ITS/AliITSNeuralPoint.cxx @@ -1,9 +1,10 @@ -// 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 //#include @@ -204,7 +205,7 @@ Bool_t AliITSNeuralPoint::HasID(Int_t ID) const // //------------------------------------------------------------------------------------------------------ // -Int_t* AliITSNeuralPoint::SharedID(AliITSNeuralPoint *p) +Int_t* AliITSNeuralPoint::SharedID(AliITSNeuralPoint *p) const { // Checks if there is a GEANT track owning both // and the recpoint in the argument diff --git a/ITS/AliITSNeuralPoint.h b/ITS/AliITSNeuralPoint.h index 03412d8ae82..2fea18e4cc8 100644 --- a/ITS/AliITSNeuralPoint.h +++ b/ITS/AliITSNeuralPoint.h @@ -1,8 +1,12 @@ #ifndef ALIITSNEURALPOINT_H #define ALIITSNEURALPOINT_H - -#include - +/////////////////////////////////////////////////////////////// +// AliITSneuralPoint // +// // +// A class which resumes the information of ITS clusters // +// in the global reference frame. // +// Author: A. Pulvirenti // +/////////////////////////////////////////////////////////////// class AliITSgeom; class AliITSgeomMatrix; class AliITSRecPoint; @@ -52,7 +56,7 @@ public: 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: diff --git a/ITS/AliITSPid.cxx b/ITS/AliITSPid.cxx index 7f49ab1572a..38e7e9df4ae 100644 --- a/ITS/AliITSPid.cxx +++ b/ITS/AliITSPid.cxx @@ -5,7 +5,7 @@ //------------------------------------------------------------// // #include #include "AliITSPid.h" -#include "TMath.h" +//#include "TMath.h" #include #include #include @@ -260,7 +260,7 @@ void AliITSPid::SetCut(Int_t n,Float_t pm,Float_t pilo,Float_t pihi, 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; diff --git a/ITS/AliITSPid.h b/ITS/AliITSPid.h index 2ba29e80e5b..fa78149a7de 100644 --- a/ITS/AliITSPid.h +++ b/ITS/AliITSPid.h @@ -1,5 +1,10 @@ #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 @@ -24,7 +29,7 @@ public: 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); diff --git a/ITS/AliITSPrintRecPoints.C b/ITS/AliITSPrintRecPoints.C index 523379e7630..ad583c7d740 100644 --- a/ITS/AliITSPrintRecPoints.C +++ b/ITS/AliITSPrintRecPoints.C @@ -54,16 +54,20 @@ void AliITSPrintRecPoints(TString rfn="galice.root",Int_t mod=-1, } // 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;mResetRecPoints(); + 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 <GetLoader("ITSLoader"); if (!loader) { Error("Reconstruct", "ITS loader not found"); @@ -58,13 +58,12 @@ void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const 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"); @@ -75,7 +74,7 @@ void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const Error("Reconstruct", "Can't get digits tree !"); return; } - + clusterer.Digits2Clusters(treeDigits, treeClusters); loader->WriteRecPoints("OVERWRITE"); @@ -86,13 +85,14 @@ void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const 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; @@ -100,7 +100,6 @@ void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader, loader->LoadRecPoints("recreate"); AliITSgeom* geom = GetITSgeom(runLoader); - if (!geom) return; AliITSclustererV2 clusterer(geom); Int_t iEvent = 0; @@ -119,6 +118,7 @@ void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader, } loader->UnloadRecPoints(); + } //_____________________________________________________________________________ @@ -126,11 +126,14 @@ AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const { // 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); + + + } //_____________________________________________________________________________ @@ -209,14 +212,16 @@ AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const 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; } + diff --git a/ITS/AliITSReconstructor.h b/ITS/AliITSReconstructor.h index 4d91b19c7ac..b0fc82919e8 100644 --- a/ITS/AliITSReconstructor.h +++ b/ITS/AliITSReconstructor.h @@ -4,6 +4,11 @@ * See cxx source for full Copyright notice */ /* $Id$ */ +/////////////////////////////////////////////////////////////////////////////// +// // +// class for ITS reconstruction // +// // +/////////////////////////////////////////////////////////////////////////////// #include "AliReconstructor.h" diff --git a/ITS/AliITSRiemannFit.cxx b/ITS/AliITSRiemannFit.cxx index 6a08853e4cd..af110c09491 100644 --- a/ITS/AliITSRiemannFit.cxx +++ b/ITS/AliITSRiemannFit.cxx @@ -54,26 +54,21 @@ -#include -#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) @@ -226,8 +221,7 @@ void FillPoints(AliITSRiemannFit::AliPointtl **Points,Int_t &index,Float_t *xpoi } // ----------------------------------------------------------------------- -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 @@ -235,23 +229,23 @@ void AliITSRiemannFit::InitPoints(Int_t ntracks,AliITS *ITS, ///////////////////////////////////////////////////////////////////// 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; modAt(mod); - ITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); TR->GetEvent(mod); Int_t nrecp = iTSrec->GetEntries(); if(!nrecp) continue; @@ -282,12 +276,14 @@ void AliITSRiemannFit::InitPoints(Int_t ntracks,AliITS *ITS, Int_t num=0,nspdi=0,nspdo=0,nsddi=0,nsddo=0,nssdi=0,nssdo=0; for (mod=0; modAt(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;irecUncheckedAt(irec); @@ -390,6 +386,8 @@ void AliITSRiemannFit::InitPoints(Int_t ntracks,AliITS *ITS, 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); diff --git a/ITS/AliITSRiemannFit.h b/ITS/AliITSRiemannFit.h index 410884ff44c..586a64c83f9 100644 --- a/ITS/AliITSRiemannFit.h +++ b/ITS/AliITSRiemannFit.h @@ -4,16 +4,20 @@ * See cxx source for full Copyright notice */ /* $Id$ */ - +///////////////////////////////////////////////////////////////////// +// Class for helix fit on the Riemann sphere // +///////////////////////////////////////////////////////////////////// #include 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 : @@ -88,7 +92,7 @@ class AliITSRiemannFit : public TObject{ 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); @@ -106,10 +110,6 @@ class AliITSRiemannFit : public TObject{ 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); diff --git a/ITS/AliITSTrackerV1.cxx b/ITS/AliITSTrackerV1.cxx index adaea7f61e0..be8b4854eab 100644 --- a/ITS/AliITSTrackerV1.cxx +++ b/ITS/AliITSTrackerV1.cxx @@ -29,17 +29,17 @@ // imposition respectively. The authors thank Mariana Bondila to have help // them to resolve some problems. July-2000 -#include #include #include #include #include #include +#include #include #include "TParticle.h" #include "AliRun.h" -#include "AliITS.h" +#include "AliITSDetTypeRec.h" #include "AliITSgeomSPD.h" #include "AliITSgeomSDD.h" #include "AliITSgeomSSD.h" @@ -59,7 +59,7 @@ ClassImp(AliITSTrackerV1) //______________________________________________________________________ AliITSTrackerV1::AliITSTrackerV1() { //Default constructor - fITS = 0; + //fITS = 0; fresult = 0; fPtref=0.; fChi2max=0.; @@ -87,60 +87,65 @@ AliITSTrackerV1::AliITSTrackerV1() { 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<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<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<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(); @@ -239,9 +244,9 @@ AliITSTrackerV1::AliITSTrackerV1(AliITS* IITTSS, Int_t evnumber, Bool_t flag) { fNRecPoints = new Int_t[numOfModules]; for(Int_t module=0; moduleResetRecPoints(); - 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]; @@ -276,6 +281,8 @@ AliITSTrackerV1::AliITSTrackerV1(AliITS* IITTSS, Int_t evnumber, Bool_t flag) { // fFieldFactor = (Double_t)fieldPointer->Factor(); fFieldFactor =(Double_t)fieldPointer-> SolenoidField()/10/.2; // cout<< " field factor = "<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]; @@ -364,6 +374,7 @@ AliITSTrackerV1::AliITSTrackerV1(const AliITSTrackerV1 &cobj) : TObject(cobj) { fRecCylZ[module][ind]=cobj.fRecCylZ[module][ind]; } } + delete rl; } /* @@ -408,7 +419,7 @@ AliITSTrackerV1 &AliITSTrackerV1::operator=(const AliITSTrackerV1 &obj) { // 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; @@ -461,7 +472,10 @@ AliITSTrackerV1 &AliITSTrackerV1::operator=(const AliITSTrackerV1 &obj) { } // 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]; @@ -481,6 +495,7 @@ AliITSTrackerV1 &AliITSTrackerV1::operator=(const AliITSTrackerV1 &obj) { } + delete rl; return *this; } //______________________________________________________________________ @@ -508,8 +523,11 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber,Int_t minTr,Int_t maxTr, 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. @@ -554,7 +572,7 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber,Int_t minTr,Int_t maxTr, 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; @@ -564,7 +582,7 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber,Int_t minTr,Int_t maxTr, for (mod=0; modResetRecPoints(); + fDetTypeRec->ResetRecPoints(); gAlice->TreeR()->GetEvent(mod); numbpoints = frecPoints->GetEntries(); totalpoints+=numbpoints; @@ -828,7 +846,7 @@ void AliITSTrackerV1::DoTracking(Int_t evNumber,Int_t minTr,Int_t maxTr, //// 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); @@ -929,7 +947,10 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { 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; indexGetSize(); index++) { AliITSTrackV1 *trackITS = (AliITSTrackV1 *) trackITSlist->At(index); @@ -1136,7 +1157,7 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { Int_t indexmod; indexmod = g1->GetModuleIndex(lycur,(Int_t)toucLad(iriv), (Int_t)toucDet(iriv)); - fITS->ResetRecPoints(); + fDetTypeRec->ResetRecPoints(); gAlice->TreeR()->GetEvent(indexmod); Int_t npoints=frecPoints->GetEntries(); @@ -1245,6 +1266,8 @@ void AliITSTrackerV1::RecursiveTracking(TList *trackITSlist) { } // end of for on tracks (index) //gObjectTable->Print(); // stampa memoria + delete rl; + } //______________________________________________________________________ Int_t AliITSTrackerV1::Intersection(AliITSTrackV1 &track,Int_t layer, diff --git a/ITS/AliITSTrackerV1.h b/ITS/AliITSTrackerV1.h index b1e8bc2ec6b..690a85682d3 100644 --- a/ITS/AliITSTrackerV1.h +++ b/ITS/AliITSTrackerV1.h @@ -24,19 +24,17 @@ #include -class AliITS; class TObjArray; class TVector; class TMatrix; class AliITSTrackV1; -class AliITS; class AliITSRad; class TStopwatch; class AliITSTrackerV1 : public TObject { public: AliITSTrackerV1(); - AliITSTrackerV1(AliITS* IITTSS, Int_t evnumber, Bool_t flag); + AliITSTrackerV1(Int_t evnumber, Bool_t flag); AliITSTrackerV1(const AliITSTrackerV1 &cobj); ~AliITSTrackerV1(); AliITSTrackerV1 &operator=(const AliITSTrackerV1 &obj); @@ -53,7 +51,8 @@ class AliITSTrackerV1 : public TObject { // Double_t sigma[2], Double_t chi2pred); private: - AliITS* fITS; //! pointer to AliITS + //AliITS* fITS; //! pointer to AliITS + AliITSDetTypeRec *fDetTypeRec;//ITS obj. for reconstruction AliITSTrackV1 *fresult; // result is a pointer to the final best track Double_t fPtref; // transvers momentum obtained from TPC tracking Double_t fChi2max; // chi2 cut @@ -86,7 +85,7 @@ class AliITSTrackerV1 : public TObject { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// Double_t fFieldFactor; // Magnetic field factor - ClassDef(AliITSTrackerV1,1) + ClassDef(AliITSTrackerV1,2) }; #endif diff --git a/ITS/AliITSVertexer.cxx b/ITS/AliITSVertexer.cxx index f66b6f56af7..f44f5b62bba 100644 --- a/ITS/AliITSVertexer.cxx +++ b/ITS/AliITSVertexer.cxx @@ -82,15 +82,15 @@ void AliITSVertexer::Clusters2RecPoints // module "idx" (entry in the tree with the clusters). // Simplified version, supposed to work with the pixels only ! //------------------------------------------------------------ - const Int_t lastSPD1=79; //let's hope the number of the SPDs will not change - const Int_t lastSPD2=239;//let's hope the number of the SPDs will not change + const Int_t klastSPD1=79; //let's hope the number of the SPDs will not change + const Int_t klastSPD2=239;//let's hope the number of the SPDs will not change Float_t yshift = 0; //see AliITSclustererV2.cxx about these shifts Float_t zshift[4] = {-10.708000, -3.536000, 3.536000, 10.708000}; //let's hope the positioning of the SPDs will not change - if (idx<=lastSPD1) { + if (idx<=klastSPD1) { yshift=0.248499; //let's hope the positioning of the SPDs will not change - } else if (idx<=lastSPD2) { + } else if (idx<=klastSPD2) { yshift=3.096207; //let's hope the positioning of the SPDs will not change } else { Fatal("Clusters2RecPoints","This is not an SPD module ! %d",idx); @@ -102,7 +102,7 @@ void AliITSVertexer::Clusters2RecPoints AliITSRecPoint p; AliITSclusterV2 *c = (AliITSclusterV2 *)clusters->UncheckedAt(i); - Float_t x=c->GetY(); if (idx<=lastSPD1) x=-x; + Float_t x=c->GetY(); if (idx<=klastSPD1) x=-x; x+=yshift; Float_t z=c->GetZ(); diff --git a/ITS/AliITSVertexer.h b/ITS/AliITSVertexer.h index 2a4fb7de49f..b1711cc35a9 100644 --- a/ITS/AliITSVertexer.h +++ b/ITS/AliITSVertexer.h @@ -20,6 +20,7 @@ class AliITSVertexer : public AliVertexer { AliITSVertexer(); // standard constructor AliITSVertexer(TString filename); + virtual ~AliITSVertexer(){;} virtual void SetUseV2Clusters(Bool_t v2c){fUseV2Clusters = v2c;} virtual void WriteCurrentVertex(); virtual void Clusters2RecPoints(const TClonesArray *clusters, Int_t idx, TClonesArray *points); diff --git a/ITS/AliITSVertexerIons.cxx b/ITS/AliITSVertexerIons.cxx index ce21ead4e80..6be5900c09f 100644 --- a/ITS/AliITSVertexerIons.cxx +++ b/ITS/AliITSVertexerIons.cxx @@ -1,16 +1,13 @@ +#include "AliITSDetTypeRec.h" #include "AliITSVertexerIons.h" #include "AliITSVertexerPPZ.h" #include "AliESDVertex.h" -#include "AliRun.h" -#include "AliITS.h" #include "AliITSgeom.h" #include "AliITSLoader.h" #include "AliITSRecPoint.h" -#include #include #include #include -#include ////////////////////////////////////////////////////////////////////// // AliITSVertexerIons is a class for full 3D primary vertex // @@ -35,7 +32,7 @@ ClassImp(AliITSVertexerIons) AliITSVertexerIons::AliITSVertexerIons():AliITSVertexer() { // Default Constructor - fITS = 0; + //fITS = 0; SetNpThreshold(); SetMaxDeltaPhi(); SetMaxDeltaZ(); @@ -45,7 +42,7 @@ ClassImp(AliITSVertexerIons) AliITSVertexerIons::AliITSVertexerIons(TString fn):AliITSVertexer(fn) { // Standard constructor - fITS = 0; + //fITS = 0; SetNpThreshold(); SetMaxDeltaPhi(); SetMaxDeltaZ(); @@ -70,7 +67,7 @@ AliITSVertexerIons& AliITSVertexerIons::operator=(const AliITSVertexerIons &/*so //______________________________________________________________________ AliITSVertexerIons::~AliITSVertexerIons() { // Default Destructor - fITS = 0; + //fITS = 0; } //______________________________________________________________________ @@ -80,19 +77,20 @@ AliESDVertex* AliITSVertexerIons::FindVertexForCurrentEvent(Int_t evnumber){ fCurrentVertex = 0; AliRunLoader *rl = AliRunLoader::GetRunLoader(); - AliITSLoader* itsloader = (AliITSLoader*) rl->GetLoader("ITSLoader"); - if(!fITS) { - fITS =(AliITS *)gAlice->GetDetector("ITS"); - if(!fITS) { - Error("FindVertexForCurrentEvent","AliITS object was not found"); - return fCurrentVertex; - } - } - fITS->SetTreeAddress(); - AliITSgeom *g2 = fITS->GetITSgeom(); - TClonesArray *recpoints = fITS->RecPoints(); - AliITSRecPoint *pnt; + AliITSLoader* itsloader = (AliITSLoader*)rl->GetLoader("ITSLoader"); + TDirectory * olddir = gDirectory; + rl->CdGAFile(); + AliITSgeom* g2 = (AliITSgeom*)gDirectory->Get("AliITSgeom"); + olddir->cd(); + TTree *tr = itsloader->TreeR(); + AliITSDetTypeRec detTypeRec; + + detTypeRec.SetTreeAddressR(tr); + + TClonesArray *recpoints = detTypeRec.RecPoints(); + AliITSRecPoint *pnt; + Int_t npoints=0; Int_t nopoints1=40000; @@ -119,7 +117,7 @@ AliESDVertex* AliITSVertexerIons::FindVertexForCurrentEvent(Int_t evnumber){ Int_t np1=0, np2=0; for(Int_t i=g2->GetStartSPD();i<=g2->GetLastSPD();i++) { - fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); tr->GetEvent(i); npoints = recpoints->GetEntries(); for (Int_t ipoint=0;ipointGetMaximum(); - bin_max=hzv->GetMaximumBin(); - maxcenter=hzv->GetBinCenter(bin_max); + binMax=hzv->GetMaximumBin(); + maxcenter=hzv->GetBinCenter(binMax); Double_t dxy=1.5; TF1 *fz = new TF1 ("fz","([0]*exp(-0.5*((x-[1])/[2])*((x-[1])/[2])))+[3]",maxcenter-dxy,maxcenter+dxy); @@ -284,6 +282,7 @@ AliESDVertex* AliITSVertexerIons::FindVertexForCurrentEvent(Int_t evnumber){ if(fDebug>0)Info("FindVertexForCurrentEvent","Vertex found for event %d",evnumber); sprintf(name,"Vertex"); fCurrentVertex = new AliESDVertex(position,resolution,snr,name); + return fCurrentVertex; } diff --git a/ITS/AliITSVertexerIons.h b/ITS/AliITSVertexerIons.h index ca74e755676..24e9bbdba6a 100644 --- a/ITS/AliITSVertexerIons.h +++ b/ITS/AliITSVertexerIons.h @@ -19,7 +19,7 @@ // // ////////////////////////////////////////////////////////////////////// -class AliITS; + class TH1F; class AliITSVertexerIons : public AliITSVertexer { @@ -39,15 +39,16 @@ class AliITSVertexerIons : public AliITSVertexer { Double_t GetMaxDeltaZ() const {return fMaxDeltaPhi;} void SetMaxDeltaZ(Double_t dz=0.15) {fMaxDeltaZ=dz;} Double_t FindMaxAround(Double_t point, TH1F *h, Double_t distance); + protected: - AliITS *fITS; //! pointer to the AliITS object + Int_t fNpThreshold; // minimum number of rec points for vertexing Double_t fMaxDeltaPhi; // Maximum phi difference for rec points correlation Double_t fMaxDeltaZ; // Maximum z difference for rec points correlation AliITSVertexerIons(const AliITSVertexerIons &source); // copy constructor (NO copy allowed: the constructor is protected to avoid misuse) AliITSVertexerIons& operator=(const AliITSVertexerIons &source); // assignment operator (NO assignment allowed) - ClassDef(AliITSVertexerIons,3); + ClassDef(AliITSVertexerIons,4); }; #endif diff --git a/ITS/AliITSVertexerPPZ.cxx b/ITS/AliITSVertexerPPZ.cxx index cea187a3c1a..53243f175f2 100644 --- a/ITS/AliITSVertexerPPZ.cxx +++ b/ITS/AliITSVertexerPPZ.cxx @@ -13,16 +13,12 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ #include -#include #include -#include #include -#include #include #include #include -#include "AliRun.h" -#include "AliITS.h" +#include "AliITSDetTypeRec.h" #include "AliITSgeom.h" #include "AliITSLoader.h" #include "AliITSRecPoint.h" @@ -50,7 +46,7 @@ AliITSVertexerPPZ::AliITSVertexerPPZ():AliITSVertexer() { SetSecondLayerModules(0); fZFound = 0; fZsig = 0.; - fITS = 0; + //fITS = 0; SetWindow(0); } @@ -63,23 +59,25 @@ AliITSVertexerPPZ::AliITSVertexerPPZ(TString fn, Float_t x0, Float_t y0):AliITSV SetSecondLayerModules(); fZFound = 0; fZsig = 0.; - fITS = 0; + //fITS = 0; SetWindow(); } //______________________________________________________________________ AliITSVertexerPPZ::~AliITSVertexerPPZ() { // Default Destructor - fITS = 0; + //fITS = 0; } //________________________________________________________ void AliITSVertexerPPZ::EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zval) { - Float_t DeltaVal = hist->GetBinWidth(1)*fWindow; // max window in Z for searching + + //Evaluation of Z + Float_t deltaVal = hist->GetBinWidth(1)*fWindow; // max window in Z for searching fZFound=0; fZsig=0; - Int_t N=0; - Int_t NbinNotZero=0; + Int_t nN=0; + Int_t nbinNotZero=0; Float_t totst = 0.; Float_t totst2 = 0.; Float_t curz = 0.; @@ -88,27 +86,27 @@ void AliITSVertexerPPZ::EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zva if(cont!=0)curz = hist->GetBinLowEdge(i)+0.5*hist->GetBinWidth(i); totst+=cont; totst2+=cont*cont; - N++; - if(cont!=0)NbinNotZero++; + nN++; + if(cont!=0)nbinNotZero++; } - if(NbinNotZero==0){fZFound=-100; fZsig=-100; return;} - if(NbinNotZero==1){ + if(nbinNotZero==0){fZFound=-100; fZsig=-100; return;} + if(nbinNotZero==1){ fZFound = curz; fZsig=0; - fCurrentVertex = new AliESDVertex(fZFound,fZsig,NbinNotZero); + fCurrentVertex = new AliESDVertex(fZFound,fZsig,nbinNotZero); return; } - Float_t errsq = totst2/(N-1)-totst*totst/N/(N-1); + Float_t errsq = totst2/(nN-1)-totst*totst/nN/(nN-1); if(errsq>=0){ totst2=TMath::Sqrt(errsq); } else { - Error("EvalZ","Negative variance: %d - %12.7f - %12.7f",N,totst2,totst); + Error("EvalZ","Negative variance: %d - %12.7f - %12.7f",nN,totst2,totst); fZFound=-100; fZsig=-100; return; } - totst /= N; + totst /= nN; Float_t cut = totst+totst2*2.; if(fDebug>1)cout<<"totst, totst2, cut: "<GetBinLowEdge(sepa); @@ -128,15 +126,15 @@ void AliITSVertexerPPZ::EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zva } } val2+=hist->GetBinWidth(1); - if((val2-val1)>DeltaVal){ - val1 = zmax-DeltaVal/2.; - val2 = zmax+DeltaVal/2.; + if((val2-val1)>deltaVal){ + val1 = zmax-deltaVal/2.; + val2 = zmax+deltaVal/2.; if(fDebug>0)cout<<"val1 and val2 recomputed\n"; } if(fDebug>0)cout<<"Values for Z finding: "<At(i); if(z=0.){ fZsig=TMath::Sqrt(errsq); } else { - Error("evalZ","Negative variance: %d - %12.7f %12.7f",N,fZsig,fZFound); + Error("evalZ","Negative variance: %d - %12.7f %12.7f",nN,fZsig,fZFound); fZsig=0; } - fZFound=fZFound/N; + fZFound=fZFound/nN; /* weights defined by the curvature fZsig=1./fZsig; fZFound*=fZsig; fZsig = TMath::Sqrt(fZsig); */ - fCurrentVertex = new AliESDVertex(fZFound,fZsig,N); + fCurrentVertex = new AliESDVertex(fZFound,fZsig,nN); } //______________________________________________________________________ @@ -181,16 +179,14 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ fZFound = -999; fZsig = -999; AliRunLoader *rl =AliRunLoader::GetRunLoader(); - AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader"); - if(!fITS) { - fITS = (AliITS*)gAlice->GetModule("ITS"); - if(!fITS) { - Error("FindVertexForCurrentEvent","AliITS object was not found"); - return fCurrentVertex; - } - } - fITS->SetTreeAddress(); - AliITSgeom *geom = fITS->GetITSgeom(); + AliITSLoader* iTSloader = (AliITSLoader*)rl->GetLoader("ITSLoader"); + TDirectory * olddir = gDirectory; + rl->CdGAFile(); + AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom"); + olddir->cd(); + + AliITSDetTypeRec detTypeRec; + if(!geom) { Error("FindVertexForCurrentEvent","ITS geometry is not defined"); return fCurrentVertex; @@ -202,12 +198,13 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ Float_t lc2[3]; for(Int_t ii=0; ii<3; ii++) lc2[ii]=0.; Float_t gc2[3]; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.; - tR = ITSloader->TreeR(); + tR = iTSloader->TreeR(); if(!tR){ Error("FindVertexForCurrentEvent","TreeR not found"); return fCurrentVertex; } - itsRec = fITS->RecPoints(); // uses slow points or fast points if slow are + detTypeRec.SetTreeAddressR(tR); + itsRec = detTypeRec.RecPoints(); // missing TClonesArray dummy("AliITSclusterV2",10000), *clusters=&dummy; TBranch *branch; @@ -244,7 +241,8 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ zave2+=gc[2]*gc[2]; firipixe++; } - fITS->ResetRecPoints(); + //fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); } if(firipixe>1){ rmszav=TMath::Sqrt(zave2/(firipixe-1)-zave*zave/firipixe/(firipixe-1)); @@ -279,7 +277,8 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ Int_t nrecp1 = itsRec->GetEntries(); TObjArray *poiL1 = new TObjArray(nrecp1); for(Int_t i=0; iAddAt(itsRec->At(i),i); - fITS->ResetRecPoints(); + //fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); for(Int_t i=0; iAt(i); lc[0]=current->GetX(); @@ -328,7 +327,8 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ } } } - fITS->ResetRecPoints(); + //fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); } } delete poiL1; @@ -347,6 +347,7 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ // fCurrentVertex->SetName(name); fCurrentVertex->SetTitle("vertexer: PPZ"); } + return fCurrentVertex; } @@ -354,8 +355,8 @@ AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){ void AliITSVertexerPPZ::FindVertices(){ // computes the vertices of the events in the range FirstEvent - LastEvent AliRunLoader *rl = AliRunLoader::GetRunLoader(); - AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader"); - ITSloader->ReloadRecPoints(); + AliITSLoader* iTSloader = (AliITSLoader*) rl->GetLoader("ITSLoader"); + iTSloader->ReloadRecPoints(); for(Int_t i=fFirstEvent;i<=fLastEvent;i++){ cout<<"Processing event "<GetEvent(i); diff --git a/ITS/AliITSVertexerPPZ.h b/ITS/AliITSVertexerPPZ.h index 05991370729..d33dc8be5b8 100644 --- a/ITS/AliITSVertexerPPZ.h +++ b/ITS/AliITSVertexerPPZ.h @@ -13,7 +13,6 @@ // // ///////////////////////////////////////////////////////////////////// -class AliITS; class TH1F; class TArrayF; @@ -35,8 +34,6 @@ class AliITSVertexerPPZ : public AliITSVertexer { static Float_t Curv(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3); - private: - void EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zval); protected: Int_t fFirstL1; // first module of the first pixel layer @@ -46,13 +43,15 @@ class AliITSVertexerPPZ : public AliITSVertexer { Float_t fDiffPhiMax; // Maximum delta phi allowed among corr. pixels Float_t fX0; // Nominal x coordinate of the vertex Float_t fY0; // Nominal y coordinate of the vertex - AliITS *fITS; //! pointer to the AliITS object + //AliITS *fITS; //! pointer to the AliITS object Float_t fZFound; //! found value for the current event Float_t fZsig; //! RMS of Z Float_t fWindow; // window width for Z search in mm (3 mm by def.) + private: + void EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zval); - ClassDef(AliITSVertexerPPZ,2); + ClassDef(AliITSVertexerPPZ,3); }; #endif diff --git a/ITS/AliITSVertexerZ.cxx b/ITS/AliITSVertexerZ.cxx index 92f64a76129..823fe8455ea 100644 --- a/ITS/AliITSVertexerZ.cxx +++ b/ITS/AliITSVertexerZ.cxx @@ -13,17 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ #include -#include #include -#include #include "AliITSLoader.h" -#include #include #include #include -#include #include #include +#include "AliITSDetTypeRec.h" #include ///////////////////////////////////////////////////////////////// @@ -48,7 +45,6 @@ AliITSVertexerZ::AliITSVertexerZ():AliITSVertexer() { SetSecondLayerModules(0); fZFound = 0; fZsig = 0.; - fITS = 0; fZCombc = 0; fZCombf = 0; SetLowLimit(0.); @@ -68,7 +64,6 @@ AliITSVertexerZ::AliITSVertexerZ(TString fn, Float_t x0, Float_t y0):AliITSVerte SetSecondLayerModules(); fZFound = 0; fZsig = 0.; - fITS = 0; fZCombc = 0; fZCombf = 0; SetLowLimit(); @@ -98,7 +93,7 @@ AliITSVertexerZ& AliITSVertexerZ::operator=(const AliITSVertexerZ& /* vtxr */){ //______________________________________________________________________ AliITSVertexerZ::~AliITSVertexerZ() { // Default Destructor - fITS = 0; + //fITS = 0; if(fZCombc)delete fZCombc; if(fZCombf)delete fZCombf; } @@ -106,35 +101,29 @@ AliITSVertexerZ::~AliITSVertexerZ() { //______________________________________________________________________ AliESDVertex* AliITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ // Defines the AliESDVertex for the current event - + fCurrentVertex = 0; AliRunLoader *rl =AliRunLoader::GetRunLoader(); - AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader"); + AliITSLoader* itsLoader = (AliITSLoader*)rl->GetLoader("ITSLoader"); + TDirectory * olddir = gDirectory; + rl->CdGAFile(); + AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom"); + olddir->cd(); + itsLoader->LoadRecPoints(); rl->GetEvent(evnumber); - if(!fITS) { - fITS = (AliITS*)gAlice->GetModule("ITS"); - if(!fITS) { - Error("FindVertexForCurrentEvent","AliITS object was not found"); - return fCurrentVertex; - } - } - - fITS->SetTreeAddress(); - - AliITSgeom *geom = fITS->GetITSgeom(); + AliITSDetTypeRec detTypeRec; TTree *tR = itsLoader->TreeR(); + detTypeRec.SetTreeAddressR(tR); TClonesArray *itsRec = 0; Float_t lc[3]; for(Int_t ii=0; ii<3; ii++) lc[ii]=0.; Float_t gc[3]; for(Int_t ii=0; ii<3; ii++) gc[ii]=0.; Float_t lc2[3]; for(Int_t ii=0; ii<3; ii++) lc2[ii]=0.; Float_t gc2[3]; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.; - itsRec = fITS->RecPoints(); - - //cout<<"Address of itsRec = "<GetEntries(); - fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); } for(Int_t module= fFirstL2; module<=fLastL2;module++){ branch->GetEvent(module); @@ -171,7 +160,7 @@ AliESDVertex* AliITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ Clusters2RecPoints(clusters,module,itsRec); } nrpL2+= itsRec->GetEntries(); - fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); } if(nrpL1 == 0 || nrpL2 == 0){ ResetHistograms(); @@ -207,7 +196,7 @@ AliESDVertex* AliITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ if(phi1[ind]<0)phi1[ind]=2*TMath::Pi()+phi1[ind]; ind++; } - fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); } ind = 0; for(Int_t module= fFirstL2; module<=fLastL2;module++){ @@ -230,7 +219,7 @@ AliESDVertex* AliITSVertexerZ::FindVertexForCurrentEvent(Int_t evnumber){ if(phi2[ind]<0)phi2[ind]=2*TMath::Pi()+phi2[ind]; ind++; } - fITS->ResetRecPoints(); + detTypeRec.ResetRecPoints(); } for(Int_t i=0;i #include "TArrayI.h" #include "TClonesArray.h" #include "AliITSdigitSSD.h" @@ -160,7 +168,7 @@ void AliITSclusterSSD::AddCross(Int_t clIndex){ (*fCrossedClusterIndexes)[fNCrosses++] = clIndex; } //______________________________________________________________________ -Int_t AliITSclusterSSD::GetCross(Int_t crIndex){ +Int_t AliITSclusterSSD::GetCross(Int_t crIndex) const { // return crossing cluster return ((crIndex>-1)&&(crIndexGetModule("ITS"); - if (!its) { - Error("Hits2Clusters","Can't find the ITS !"); - return 2; - } - AliITSgeom *geom=its->GetITSgeom(); - Int_t mmax=geom->GetIndexMax(); - - its->InitModules(-1,mmax); - its->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=its->RecPoints(); - AliITSsimulationFastPoints sim; - Int_t ncl=0; - for (Int_t m=0; mGetModule(m); - sim.CreateFastRecPoints(mod,m,gRandom); - - RecPoints2Clusters(points, m, clusters); - its->ResetRecPoints(); - - ncl+=clusters->GetEntriesFast(); - cTree->Fill(); - clusters->Clear(); - } - - Info("Hits2Clusters","Number of found fast clusters : %d",ncl); - - //cTree->Write(); - - delete clusters; - - return 0; -} - //*********************************** #ifndef V1 @@ -1706,7 +1659,7 @@ void AliITSclustererV2::FindClustersSSD(AliITSRawStream* input, #else //V1 #include "AliITSDetType.h" - +#include "AliITS.h" #include "AliITSsegmentationSPD.h" #include "AliITSClusterFinderSPD.h" diff --git a/ITS/AliITSclustererV2.h b/ITS/AliITSclustererV2.h index 4eadc8afc0e..01d297830d8 100644 --- a/ITS/AliITSclustererV2.h +++ b/ITS/AliITSclustererV2.h @@ -36,7 +36,6 @@ public: void FindClustersSSD(AliITSRawStream* input, TClonesArray** clusters); void RecPoints2Clusters(const TClonesArray *p, Int_t idx, TClonesArray *c); - Int_t Hits2Clusters(TTree *in, TTree *out); private: class Ali1Dcluster { diff --git a/ITS/AliITSdcsSSD.cxx b/ITS/AliITSdcsSSD.cxx index eca282a8e04..1c777f8e040 100644 --- a/ITS/AliITSdcsSSD.cxx +++ b/ITS/AliITSdcsSSD.cxx @@ -4,6 +4,22 @@ #include "AliITSdcsSSD.h" #include "AliITSresponseSSD.h" #include "AliITSsegmentationSSD.h" +/////////////////////////////////////////////////////////////////////////// +// // +// Class AliITSdcsSSD // +// describes Detector Control System parameters for one SSD module. // +// // +// This class stores parametrers such as gain, threshold // +// capacitive coupling. // +// // +// Class takes care of invalid strip menagement during // +// simulation and runtime // +// // +// // +// created at: Warsaw University of Technology // +// ver. 1.0 WARSAW, 23.12.1999 // +// // +/////////////////////////////////////////////////////////////////////////// ClassImp(AliITSdcsSSD) @@ -138,7 +154,7 @@ void AliITSdcsSSD::SetInvalidParam(Float_t mean, Float_t sigma) { fISigma = (fISigma > fNstrips/10) ? fNstrips/10 : fISigma; } //______________________________________________________________________ -void AliITSdcsSSD::GetInvalidParam(Float_t &mean, Float_t &sigma) { +void AliITSdcsSSD::GetInvalidParam(Float_t &mean, Float_t &sigma) const { // get invalid param mean = fNInvalid; diff --git a/ITS/AliITSdcsSSD.h b/ITS/AliITSdcsSSD.h index 545d8685005..1499f3ee4bf 100644 --- a/ITS/AliITSdcsSSD.h +++ b/ITS/AliITSdcsSSD.h @@ -4,22 +4,22 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -//____________________________________________________________________ -// -// Class AliITSdcsSSD -// describes Detector Control System parameters for one SSD module. -// -// This class stores parametrers such as gain, threshold -// capacitive coupling. -// -// Class takes care of invalid strip menagement during -// simulation and runtime -// -// -// created at: Warsaw University of Technology -// ver. 1.0 WARSAW, 23.12.1999 -// -//___________________________________________________________________ +/////////////////////////////////////////////////////////////////////////// +// // +// Class AliITSdcsSSD // +// describes Detector Control System parameters for one SSD module. // +// // +// This class stores parametrers such as gain, threshold // +// capacitive coupling. // +// // +// Class takes care of invalid strip menagement during // +// simulation and runtime // +// // +// // +// created at: Warsaw University of Technology // +// ver. 1.0 WARSAW, 23.12.1999 // +// // +/////////////////////////////////////////////////////////////////////////// #include @@ -43,7 +43,7 @@ class AliITSdcsSSD: public TObject { //________________________________________________________________ // Parameters for invalid strips MonteCarlo void SetInvalidParam(Float_t mean, Float_t sigma); - void GetInvalidParam(Float_t &mean, Float_t &sigma); + void GetInvalidParam(Float_t &mean, Float_t &sigma) const; // Methods for creating invalid strips void SetInvalidMC(Float_t mean, Float_t sigma); void SetInvalidMC(); @@ -58,13 +58,13 @@ class AliITSdcsSSD: public TObject { // Creating invalid strips void SetInvalidP(Int_t,Bool_t){}//Set invalid if true void SetInvalidN(Int_t,Bool_t){}//Set invalid if true - Float_t GetCouplingPR() {// couplings + Float_t GetCouplingPR() const {// couplings return fCouplingPR;} - Float_t GetCouplingPL() {// couplings + Float_t GetCouplingPL() const {// couplings return fCouplingPL;} - Float_t GetCouplingNR() {// couplings + Float_t GetCouplingNR() const {// couplings return fCouplingNR;} - Float_t GetCouplingNL() {// couplings + Float_t GetCouplingNL() const {// couplings return fCouplingNL;} protected: diff --git a/ITS/AliITSdigit.cxx b/ITS/AliITSdigit.cxx index 65d46eba2e5..1ef5b3d8d0d 100644 --- a/ITS/AliITSdigit.cxx +++ b/ITS/AliITSdigit.cxx @@ -17,11 +17,10 @@ //////////////////////////////////////////////// // Digits classes for all ITS detectors // +// // +// // //////////////////////////////////////////////// -#include -#include -#include -#include + #include "AliITSdigit.h" //______________________________________________________________________ @@ -34,13 +33,13 @@ AliITSdigit::AliITSdigit(const Int_t *digits) { fSignal = digits[2]; } //______________________________________________________________________ -void AliITSdigit::Print(ostream *os){ +void AliITSdigit::Print(ostream *os) { //Standard output format for this class *os << fCoord1 <<","<< fCoord2 <<","<< fSignal; } //______________________________________________________________________ -void AliITSdigit::Read(istream *os){ +void AliITSdigit::Read(istream *os) { //Standard input for this class *os >> fCoord1 >> fCoord2 >> fSignal; diff --git a/ITS/AliITSdigitSDD.cxx b/ITS/AliITSdigitSDD.cxx index 35a55c12d14..3d357bd512e 100644 --- a/ITS/AliITSdigitSDD.cxx +++ b/ITS/AliITSdigitSDD.cxx @@ -17,7 +17,6 @@ #include #include #include -#include /////////////////////////////////////////////////////////////////// // // @@ -44,9 +43,9 @@ AliITSdigitSDD::AliITSdigitSDD():AliITSdigit(){ SetSignalExpanded(-1000); } //________________________________________________________________________ -AliITSdigitSDD::AliITSdigitSDD(Float_t phys,const Int_t *digits): - AliITSdigit(digits){ - // Creates a simulated SDD digit object to be updated +AliITSdigitSDD::AliITSdigitSDD(Float_t phys,const Int_t *digits): AliITSdigit(digits){ + + // Creates a simulated SDD digit object to be updated fPhysics = phys; SetSignalExpanded(-1000); @@ -55,6 +54,7 @@ AliITSdigitSDD::AliITSdigitSDD(Float_t phys,const Int_t *digits): //________________________________________________________________________ void AliITSdigitSDD::InitObject(Float_t phys,const Int_t *tracks, const Int_t *hits,const Float_t *charges){ + // Protected function used by standard constructors fPhysics = phys; for(Int_t i=0; iConvert8to10(digits[2])); @@ -94,6 +94,7 @@ AliITSdigitSDD::AliITSdigitSDD( Float_t phys,const Int_t *digits, //______________________________________________________________________ Int_t AliITSdigitSDD::GetListOfTracks(TArrayI &t,TArrayF &c){ + // Fills the TArrayI t with the tracks found in fTracks removing // duplicated tracks, summing up their charge, and ordering the tracks // by the charge contributed to this digit. It will return @@ -159,7 +160,9 @@ Int_t AliITSdigitSDD::GetListOfTracks(TArrayI &t,TArrayF &c){ //______________________________________________________________________ void AliITSdigitSDD::Print(ostream *os){ - //Standard output format for this class + + + //Standard output format for this class Int_t i; AliITSdigit::Print(os); @@ -171,8 +174,9 @@ void AliITSdigitSDD::Print(ostream *os){ } //______________________________________________________________________ void AliITSdigitSDD::Read(istream *os){ - //Standard input for this class - Int_t i; + + //Standard input for this class + Int_t i; AliITSdigit::Read(os); *os >>fPhysics; @@ -183,14 +187,16 @@ void AliITSdigitSDD::Read(istream *os){ } //______________________________________________________________________ ostream &operator<<(ostream &os,AliITSdigitSDD &source){ - // Standard output streaming function. + + // Standard output streaming function. source.Print(&os); return os; } //______________________________________________________________________ istream &operator>>(istream &os,AliITSdigitSDD &source){ - // Standard output streaming function. + + // Standard output streaming function. source.Read(&os); return os; diff --git a/ITS/AliITSdigitSDD.h b/ITS/AliITSdigitSDD.h index 1ec1bb0454a..b27b5f97947 100644 --- a/ITS/AliITSdigitSDD.h +++ b/ITS/AliITSdigitSDD.h @@ -2,7 +2,9 @@ #define ALIITSDIGITSDD_H /* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - +//////////////////////////////////////////////////////// +// Digit class for SDD // +//////////////////////////////////////////////////////// #include class AliITSresponseSDD; @@ -28,9 +30,9 @@ class AliITSdigitSDD: public AliITSdigit { // returns the array size used to store Tracks and Hits static Int_t GetNTracks() {return fgkSsdd;} // returns pointer to the array of tracks which make this digit - virtual Int_t *GetTracks() {return &fTracks[0];} + virtual Int_t *GetTracks() {return &fTracks[0];} // returns the pointer to the array of hits which made this digit - virtual Int_t *GetHits() {return &fHits[0];} + virtual Int_t *GetHits() {return &fHits[0];} virtual Int_t GetSignal() const {return fSignalExpanded;} virtual Int_t GetCompressedSignal() const {return fSignal;} // returns track number kept in the array element i of fTracks diff --git a/ITS/AliITSdigitSPD.h b/ITS/AliITSdigitSPD.h index aad05f94375..edf8df7e953 100644 --- a/ITS/AliITSdigitSPD.h +++ b/ITS/AliITSdigitSPD.h @@ -2,7 +2,9 @@ #define ALIITSDIGITSPD_H /* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - +///////////////////////////////////////////////////////////// +// Digit class for SPD // +///////////////////////////////////////////////////////////// #include //______________________________________________________________________ @@ -19,7 +21,7 @@ class AliITSdigitSPD: public AliITSdigit { // returns the signal in electrons Int_t GetSignalSPD() const {return fSignalSPD;} // returns pointer to the array of tracks which make this digit - virtual Int_t *GetTracks() {return &fTracks[0];} + virtual Int_t *GetTracks() {return &fTracks[0];} //returns the pointer to the array of hits which made this digit virtual Int_t *GetHits() {return &fHits[0];} // returns track number kept in the array element i of fTracks diff --git a/ITS/AliITSdigitSSD.h b/ITS/AliITSdigitSSD.h index c62f49c3759..520c8f82bed 100644 --- a/ITS/AliITSdigitSSD.h +++ b/ITS/AliITSdigitSSD.h @@ -2,6 +2,9 @@ #define ALIITSDIGITSSD_H /* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +//////////////////////////////////////////////////////// +// Digit class for SSD // +//////////////////////////////////////////////////////// #include diff --git a/ITS/AliITSetfSDD.h b/ITS/AliITSetfSDD.h index 454431c309b..7b814cdad1a 100644 --- a/ITS/AliITSetfSDD.h +++ b/ITS/AliITSetfSDD.h @@ -4,6 +4,14 @@ * See cxx source for full Copyright notice */ /* $Id$ */ +//////////////////////////////////////////////////////////////////////// +// Version: 0 // +// Written by Piergiorgio Cerello // +// November 24 1999 // +// // +// AliITSetfSDD is the class describing // +// the electronics for the ITS SDDs. // +//////////////////////////////////////////////////////////////////////// #include @@ -12,14 +20,6 @@ class TString; class AliITSetfSDD : public TObject { -//////////////////////////////////////////////////////////////////////// -// Version: 0 -// Written by Piergiorgio Cerello -// November 24 1999 -// -// AliITSetfSDD is the class describing the electronics for the ITS SDDs. -// -//////////////////////////////////////////////////////////////////////// public: diff --git a/ITS/AliITSmodule.cxx b/ITS/AliITSmodule.cxx index f2d1d7d9f59..db7a2ceb5b4 100644 --- a/ITS/AliITSmodule.cxx +++ b/ITS/AliITSmodule.cxx @@ -113,7 +113,7 @@ Int_t AliITSmodule::AddHit(AliITShit* hit,Int_t t,Int_t h) { } //___________________________________________________________________________ Double_t AliITSmodule::PathLength(Int_t index,AliITShit *itsHit1, - AliITShit *itsHit2){ + AliITShit *itsHit2) { // path lenght Float_t x1g,y1g,z1g; Float_t x2g,y2g,z2g; @@ -134,7 +134,7 @@ void AliITSmodule::PathLength(Int_t index, Int_t status,Int_t &nseg, Float_t &x1,Float_t &y1,Float_t &z1, Float_t &dx1,Float_t &dy1,Float_t &dz1, - Int_t &flag){ + Int_t &flag) const{ // path length static Float_t x0,y0,z0; @@ -343,7 +343,7 @@ void AliITSmodule::MedianHitG(Int_t index, //___________________________________________________________________________ Bool_t AliITSmodule::MedianHitL( AliITShit *itsHit1, AliITShit *itsHit2, - Float_t &xMl, Float_t &yMl, Float_t &zMl){ + Float_t &xMl, Float_t &yMl, Float_t &zMl) const{ // median hit Float_t x1l,y1l,z1l; Float_t x2l,y2l,z2l; diff --git a/ITS/AliITSmodule.h b/ITS/AliITSmodule.h index 56171b9be09..e49468c64ff 100644 --- a/ITS/AliITSmodule.h +++ b/ITS/AliITSmodule.h @@ -4,6 +4,19 @@ * See cxx source for full Copyright notice */ /* $Id$ */ +/////////////////////////////////////////////////////////////////////// +// // +// Class AliITSmodule // +// is a superclass for AliITSmoduleSSD, SPD and SDD. // +// The main function of modules is to simulate DIGITS from // +// GEANT HITS and produce POINTS from DIGITS // +// It also make fast simulation without use of DIGITS // +// // +// created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski // +// R.Barbera, B. Batynia, B. Nilsen // +// ver. 1.0 CERN, 16.09.1999 // +// // +/////////////////////////////////////////////////////////////////////// #include #include @@ -15,20 +28,6 @@ class AliITShit; class AliITSmodule:public TObject{ -//________________________________________________________________ -// -// Class AliITSmodule -// is a superclass for AliITSmoduleSSD, SPD and SDD. -// The main function of modules is to simulate DIGITS from -// GEANT HITS and produce POINTS from DIGITS -// It also make fast simulation without use of DIGITS -// -// created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski -// R.Barbera, B. Batynia, B. Nilsen -// ver. 1.0 CERN, 16.09.1999 -// -//________________________________________________________________ -// public: //________________________________________________________________ @@ -107,7 +106,7 @@ class AliITSmodule:public TObject{ // Computes mean local location from hits that make up a track passing // through a volume. Bool_t MedianHitL(AliITShit *h1,AliITShit *h2, - Float_t &x,Float_t &y,Float_t &z); + Float_t &x,Float_t &y,Float_t &z) const; void MedianHitL(Int_t,AliITShit *,AliITShit *,Float_t &,Float_t &, Float_t &){}; Double_t PathLength(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2); @@ -118,7 +117,7 @@ class AliITSmodule:public TObject{ Int_t &flag); void PathLength(Int_t index,Float_t x,Float_t y,Float_t z,Int_t status, Int_t &nseg,Float_t &x1,Float_t &y1,Float_t &z1, - Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag); + Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag) const; Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b, Double_t &c,Double_t &d,Double_t &e,Double_t &f, Double_t &de); diff --git a/ITS/AliITSpackageSSD.h b/ITS/AliITSpackageSSD.h index 5060e11024a..3228d6c9577 100644 --- a/ITS/AliITSpackageSSD.h +++ b/ITS/AliITSpackageSSD.h @@ -10,7 +10,6 @@ //#include "AliITSclusterSSD.h" -class AliITS; class AliITSclusterSSD; //------------------------------------------------------------------- diff --git a/ITS/AliITSreconstruction.cxx b/ITS/AliITSreconstruction.cxx index 2ea5a0c659e..00cd8ce126d 100644 --- a/ITS/AliITSreconstruction.cxx +++ b/ITS/AliITSreconstruction.cxx @@ -16,32 +16,19 @@ /* $Id$ */ ///////////////////////////////////////////////////////////////////////// // // -// // +// Class for ITS RecPoint reconstruction // // // //////////////////////////////////////////////////////////////////////// -#include -#include -#include #include -#include - #include "AliRun.h" #include "AliRunLoader.h" - -#include "AliITS.h" -#include "AliITSDetType.h" +#include "AliITSDetTypeRec.h" #include "AliITSLoader.h" #include "AliITSreconstruction.h" -#include "AliITSsegmentationSPD.h" -#include "AliITSsegmentationSDD.h" -#include "AliITSsegmentationSSD.h" -#include "AliITSClusterFinderSPD.h" -#include "AliITSClusterFinderSDD.h" -#include "AliITSClusterFinderSSD.h" -#include "AliITSresponseSDD.h" #include "AliITSgeom.h" + ClassImp(AliITSreconstruction) //______________________________________________________________________ @@ -49,7 +36,7 @@ AliITSreconstruction::AliITSreconstruction(): fInit(kFALSE), fEnt(0), fEnt0(0), - fITS(0x0), + //fITS(0x0), fDfArp(kFALSE), fLoader(0x0), fRunLoader(0x0) @@ -69,7 +56,7 @@ AliITSreconstruction::AliITSreconstruction(AliRunLoader *rl): fInit(kFALSE), fEnt(0), fEnt0(0), - fITS(0x0), + //fITS(0x0), fDfArp(kFALSE), fLoader(0x0), fRunLoader(rl) @@ -81,7 +68,7 @@ AliITSreconstruction::AliITSreconstruction(const char* filename): fInit(kFALSE), fEnt(0), fEnt0(0), - fITS(0x0), + //fITS(0x0), fDfArp(kFALSE), fLoader(0x0), fRunLoader(0x0) @@ -116,11 +103,28 @@ AliITSreconstruction::AliITSreconstruction(const char* filename): } // end if !gAlice } +//______________________________________________________________________ +AliITSreconstruction::AliITSreconstruction(const AliITSreconstruction &/*rec*/):TTask(/*rec*/){ + // Copy constructor. + + Error("Copy constructor","Copy constructor not allowed"); + +} +//______________________________________________________________________ +AliITSreconstruction& AliITSreconstruction::operator=(const AliITSreconstruction& /*source*/){ + // Assignment operator. This is a function which is not allowed to be + // done. + Error("operator=","Assignment operator not allowed\n"); + return *this; +} + //______________________________________________________________________ AliITSreconstruction::~AliITSreconstruction(){ // A destroyed AliITSreconstruction class. + + //fITS = 0; delete fRunLoader; - fITS = 0; + } //______________________________________________________________________ Bool_t AliITSreconstruction::Init(){ @@ -146,20 +150,14 @@ Bool_t AliITSreconstruction::Init(){ fInit = kFALSE; } - //Int_t retcode; - fITS = (AliITS*) gAlice->GetDetector("ITS"); - if(!fITS){ - cout << "ITS not found aborting. fITS=" << fITS << endl; - fInit = kFALSE; - return fInit; - } // end if !fITS - if(!(fITS->GetITSgeom())){ - cout << "ITSgeom not found aborting."<< endl; - fInit = kFALSE; - return fInit; - } // end if !GetITSgeom() // Now ready to init. + + fRunLoader->CdGAFile(); + fITSgeom = (AliITSgeom*)gDirectory->Get("AliITSgeom"); + fDetTypeRec = new AliITSDetTypeRec(); + fDetTypeRec->SetITSgeom(fITSgeom); + fDetTypeRec->SetDefaults(); fDet[0] = fDet[1] = fDet[2] = kTRUE; fEnt0 = 0; @@ -170,9 +168,14 @@ Bool_t AliITSreconstruction::Init(){ fLoader->LoadRecPoints("recreate"); fLoader->LoadRawClusters("recreate"); if (fLoader->TreeR() == 0x0) fLoader->MakeTree("R"); - fITS->MakeBranch("R"); - fITS->MakeBranchC(); - fITS->SetTreeAddress(); + if (fLoader->TreeC() == 0x0) fLoader->MakeTree("C"); + + fDetTypeRec->SetLoader(fLoader); + fDetTypeRec->MakeBranchR(0); + fDetTypeRec->MakeBranchC(); + fDetTypeRec->SetTreeAddress(); + fDetTypeRec->SetTreeAddressR(fLoader->TreeR()); + fInit = InitRec(); Info("Init"," Done\n\n\n"); @@ -188,45 +191,49 @@ Bool_t AliITSreconstruction::InitRec(){ // none. // Return: // none. - AliITSDetType *idt; - + /* + //AliITSDetType *idt; + fDetTypeRec->SetLoader(fLoader); // SPD - if(fDet[kSPD]){ - Info("InitRec","SPD"); - idt = fITS->DetType(kSPD); - AliITSsegmentationSPD *segSPD = (AliITSsegmentationSPD*)idt->GetSegmentationModel(); - TClonesArray *digSPD = fITS->DigitsAddress(kSPD); - TClonesArray *recpSPD = fITS->ClustersAddress(kSPD); - Info("InitRec","idt = %#x; digSPD = %#x; recpSPD = %#x",idt,digSPD,recpSPD); + if(fDet[kSPD]){ + Info("InitRec","SPD"); + //idt = fITS->DetType(kSPD); + AliITSsegmentationSPD *segSPD = (AliITSsegmentationSPD*)fDetTypeRec->GetSegmentationModel(0); + TClonesArray *digSPD = fDetTypeRec->DigitsAddress(kSPD); + TClonesArray *recpSPD = fDetTypeRec->ClustersAddress(kSPD); + Info("InitRec","idt = %#x; digSPD = %#x; recpSPD = %#x",fDetTypeRec,digSPD,recpSPD); AliITSClusterFinderSPD *recSPD = new AliITSClusterFinderSPD(segSPD,digSPD,recpSPD); - fITS->SetReconstructionModel(kSPD,recSPD); + fDetTypeRec->SetReconstructionModel(kSPD,recSPD); } // end if fDet[kSPD]. - // SDD - if(fDet[kSDD]){ - Info("InitRec","SDD"); - idt = fITS->DetType(kSDD); - AliITSsegmentationSDD *segSDD = (AliITSsegmentationSDD*) - idt->GetSegmentationModel(); - AliITSresponseSDD *resSDD = (AliITSresponseSDD*) - idt->GetResponseModel(); - TClonesArray *digSDD = fITS->DigitsAddress(kSDD); - TClonesArray *recpSDD = fITS->ClustersAddress(kSDD); - AliITSClusterFinderSDD *recSDD =new AliITSClusterFinderSDD(segSDD, - resSDD, - digSDD,recpSDD); - fITS->SetReconstructionModel(kSDD,recSDD); - } // end if fDet[kSDD] + // SDD + if(fDet[kSDD]){ + Info("InitRec","SDD"); + // idt = fITS->DetType(kSDD); + AliITSsegmentationSDD *segSDD = (AliITSsegmentationSDD*) + fDetTypeRec->GetSegmentationModel(1); + AliITSresponseSDD *resSDD = (AliITSresponseSDD*) + fDetTypeRec->GetCalibrationModel(fDetTypeRec->GetITSgeom()->GetStartSDD()); + TClonesArray *digSDD = fDetTypeRec->DigitsAddress(kSDD); + TClonesArray *recpSDD = fDetTypeRec->ClustersAddress(kSDD); + AliITSClusterFinderSDD *recSDD =new AliITSClusterFinderSDD(segSDD, + resSDD, + digSDD,recpSDD); + fDetTypeRec->SetReconstructionModel(kSDD,recSDD); + } // end if fDet[kSDD] // SSD - if(fDet[kSSD]){ - Info("InitRec","SSD"); - idt = fITS->DetType(kSSD); - AliITSsegmentationSSD *segSSD = (AliITSsegmentationSSD*) - idt->GetSegmentationModel(); - TClonesArray *digSSD = fITS->DigitsAddress(kSSD); + if(fDet[kSSD]){ + Info("InitRec","SSD"); + //idt = fITS->DetType(kSSD); + AliITSsegmentationSSD *segSSD = (AliITSsegmentationSSD*) + fDetTypeRec->GetSegmentationModel(2); + TClonesArray *digSSD = fDetTypeRec->DigitsAddress(kSSD); AliITSClusterFinderSSD *recSSD =new AliITSClusterFinderSSD(segSSD, - digSSD); - fITS->SetReconstructionModel(kSSD,recSSD); + digSSD); + recSSD->SetITSgeom(fDetTypeRec->GetITSgeom()); + fDetTypeRec->SetReconstructionModel(kSSD,recSSD); } // end if fDet[kSSD] + */ + fDetTypeRec->SetDefaultClusterFinders(); Info("InitRec"," Done\n"); return kTRUE; } @@ -258,7 +265,6 @@ void AliITSreconstruction::Exec(const Option_t *opt){ cout << "Initilization Failed, Can't run Exec." << endl; return; } // end if !fInit - for(evnt=0;evntGetEvent(evnt); + fDetTypeRec->SetITSgeom(fITSgeom); + fDetTypeRec->SetLoader(fLoader); if (fLoader->TreeR() == 0x0) fLoader->MakeTree("R"); - fITS->MakeBranch("R"); - if (fLoader->TreeC() == 0x0) fITS->MakeTreeC(); - fITS->SetTreeAddress(); - fITS->DigitsToRecPoints(evnt,0,lopt); + fDetTypeRec->MakeBranchR(0); + if (fLoader->TreeC() == 0x0){ + fDetTypeRec->MakeTreeC(); + fDetTypeRec->MakeBranchC(); + } + fDetTypeRec->SetTreeAddressR(fLoader->TreeR()); + fDetTypeRec->SetTreeAddressD(fLoader->TreeD()); + fDetTypeRec->DigitsToRecPoints(evnt,0,lopt); } // end for evnt } //______________________________________________________________________ diff --git a/ITS/AliITSreconstruction.h b/ITS/AliITSreconstruction.h index debc5fd7c7a..25013210545 100644 --- a/ITS/AliITSreconstruction.h +++ b/ITS/AliITSreconstruction.h @@ -6,38 +6,42 @@ /* $Id$ */ +///////////////////////////////////////////////////////////////////////// +// // +// Class for ITS RecPoint reconstruction // +// // +//////////////////////////////////////////////////////////////////////// #include class AliRunLoader; class TString; -class AliITS; class AliITSreconstruction : public TTask{ public: AliITSreconstruction(); // default constructor AliITSreconstruction(const char *filename); // standard constructor AliITSreconstruction(AliRunLoader *rl); // standard constructor + AliITSreconstruction(const AliITSreconstruction& rec); + AliITSreconstruction& operator=(const AliITSreconstruction &source); virtual ~AliITSreconstruction();//Destructor virtual Bool_t Init(); virtual void Exec(const Option_t *opt="ALL"); virtual void SetOutputFile(TString filename); private: - AliITSreconstruction(const AliITSreconstruction &); - AliITSreconstruction & operator=(const AliITSreconstruction &); Bool_t InitRec(); // Standard Reconstrution initilization. private: Bool_t fDet[3]; //! logical specifing which detectors to reconstruct. Bool_t fInit; //! True if Init was sucessfull, else false. Int_t fEnt; //! Number of events to processevent index. Int_t fEnt0; //! first event to process, default 0. - AliITS *fITS; //! Local pointer to ITS class. + AliITSDetTypeRec *fDetTypeRec; //!ITS obj. for reconstruction Bool_t fDfArp; //! if True then delete fRunLoader in destructor. - + AliITSgeom* fITSgeom;//! ITS geometry AliITSLoader *fLoader; //! ITS loader AliRunLoader* fRunLoader;//!Run Loader - - ClassDef(AliITSreconstruction,2) // Task to Reconstruct ITS from Digits. + + ClassDef(AliITSreconstruction,3) // Task to Reconstruct ITS from Digits. }; #endif diff --git a/ITS/AliITSsimulation.cxx b/ITS/AliITSsimulation.cxx index 3f61040b5c7..1cf754b5e92 100644 --- a/ITS/AliITSsimulation.cxx +++ b/ITS/AliITSsimulation.cxx @@ -12,7 +12,11 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ - +////////////////////////////////////////////////////////////////////////////// +// This is the base class for ITS detector signal simulations. Data members // +// include are a pointer to the detectors specific response and segmentation// +// classes. See the detector specific implementations for the propper code. // +////////////////////////////////////////////////////////////////////////////// #include "TClonesArray.h" #include "AliITSsimulation.h" diff --git a/ITS/AliITSsimulation.h b/ITS/AliITSsimulation.h index 329083d25c2..faebb47e0f0 100644 --- a/ITS/AliITSsimulation.h +++ b/ITS/AliITSsimulation.h @@ -65,7 +65,7 @@ class AliITSsimulation : public TObject { virtual void DigitiseModule(AliITSmodule *,Int_t,Int_t) {;} // digitizes module using the "fast" detector simulator. virtual void CreateFastRecPoints(AliITSmodule *,Int_t, - TRandom *) {;} + TRandom *,TClonesArray* /*recp*/) {;} // Return pointer to Response model virtual AliITSresponse* GetResponseModel(){return fResponse;} // set pointer to Response model diff --git a/ITS/AliITSsimulationFastPoints.cxx b/ITS/AliITSsimulationFastPoints.cxx index b4b6ef08b45..a9e34f114e0 100644 --- a/ITS/AliITSsimulationFastPoints.cxx +++ b/ITS/AliITSsimulationFastPoints.cxx @@ -14,6 +14,12 @@ **************************************************************************/ /* $Id$ */ +////////////////////////////////////////////////////////// +// implements fast simulation // +// // +// // +////////////////////////////////////////////////////////// + #include @@ -46,91 +52,94 @@ AliITSsimulationFastPoints::AliITSsimulationFastPoints() } //------------------------------------------------------------- -void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){ +void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module, TClonesArray* recp){ // Fast points simulator AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)), - module,gRandom); + module,gRandom,recp); } //------------------------------------------------------------- void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod, Int_t module, - TRandom *random){ - // Fast points simulator - AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); - AliITSgeom *gm = aliITS->GetITSgeom(); - - const Float_t kdEdXtoQ = 2.778e+8; - - Int_t ihit,flag,numofhits; - Float_t locals[3]; - Float_t globals[3]; - Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.; - Float_t deltaXl,deltaZl,deltaDe; - - Int_t hitlay, hitlad, hitdet, hitstatus; - Float_t hitpx, hitpy, hitpz, hitdestep; - - Int_t hitstatus1, hittrack1; - Float_t hitx1, hity1, hitz1; - Float_t hitdestep1; - Float_t xMg,yMg,zMg; - - numofhits = mod->GetNhits(); - //printf("numofhits %d \n",numofhits); - for(ihit=0;ihitGetHit(ihit); - hit->GetPositionG(hitx1,hity1,hitz1); - hitstatus1 = hit->GetTrackStatus(); - hitdestep1 = hit->GetIonization(); - hittrack1 = hit->GetTrack(); - - mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag); - if (flag!=1) { - hitdestep = hit->GetIonization(); - - if (hitdestep > 0) { - hit->GetDetectorID(hitlay,hitlad,hitdet); - hit->GetMomentumG(hitpx,hitpy,hitpz); - hitstatus = hitstatus1; + TRandom *random, + TClonesArray* recp) { + // Fast points simulator + + TClonesArray &pt=*recp; + AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS"); + AliITSgeom *gm = aliITS->GetITSgeom(); + const Float_t kdEdXtoQ = 2.778e+8; + + Int_t ihit,flag,numofhits; + Float_t locals[3]; + Float_t globals[3]; + Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.; + Float_t deltaXl,deltaZl,deltaDe; + + Int_t hitlay, hitlad, hitdet, hitstatus; + Float_t hitpx, hitpy, hitpz, hitdestep; + + Int_t hitstatus1, hittrack1; + Float_t hitx1, hity1, hitz1; + Float_t hitdestep1; + Float_t xMg,yMg,zMg; + Int_t irecp=0; + numofhits = mod->GetNhits(); + //printf("numofhits %d \n",numofhits); + for(ihit=0;ihitGetHit(ihit); + hit->GetPositionG(hitx1,hity1,hitz1); + hitstatus1 = hit->GetTrackStatus(); + hitdestep1 = hit->GetIonization(); + hittrack1 = hit->GetTrack(); + + mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag); + if (flag!=1) { + hitdestep = hit->GetIonization(); + + if (hitdestep > 0) { + hit->GetDetectorID(hitlay,hitlad,hitdet); + hit->GetMomentumG(hitpx,hitpy,hitpz); + hitstatus = hitstatus1; // Transform to the module local frame - globals[0] = xMg; - globals[1] = yMg; - globals[2] = zMg; - gm->GtoL(hitlay,hitlad,hitdet,globals,locals); - // Retrieve sigma values for position and energy, and energy - // threshold - sigmarphi = SigmaRPhi(hitlay); - sigmaz = SigmaZ(hitlay); - sigmade = SigmaDe(hitlay); - thrde = ThrDe(hitlay); - deltaXl = random->Gaus(0,sigmarphi); - deltaZl = random->Gaus(0,sigmaz); - deltaDe = random->Gaus(0,sigmade); - - // Apply energy threshold and trasform back to global reference - // system - - if ( (hitdestep+deltaDe) > thrde ){ - locals[0] += deltaXl; - locals[2] += deltaZl; - AliITSRecPoint rp; - rp.fTracks[0]=hit->GetTrack(); - // rp.fTracks[0]=mod->GetHitTrackIndex(ihit); - rp.fTracks[1]=-3; - rp.fTracks[2]=-3; - rp.SetX(locals[0]); - rp.SetZ(locals[2]); - rp.SetdEdX(hitdestep+deltaDe); - rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e - rp.SetSigmaX2(sigmarphi*sigmarphi); - rp.SetSigmaZ2(sigmaz*sigmaz); - aliITS->AddRecPoint(rp); - } // end if ( (hitdestep+deltaDe) - } // end if (hitdestep > 0) - } // end if (flag!=1) - } // end for ihit + globals[0] = xMg; + globals[1] = yMg; + globals[2] = zMg; + gm->GtoL(hitlay,hitlad,hitdet,globals,locals); + // Retrieve sigma values for position and energy, and energy + // threshold + sigmarphi = SigmaRPhi(hitlay); + sigmaz = SigmaZ(hitlay); + sigmade = SigmaDe(hitlay); + thrde = ThrDe(hitlay); + deltaXl = random->Gaus(0,sigmarphi); + deltaZl = random->Gaus(0,sigmaz); + deltaDe = random->Gaus(0,sigmade); + + // Apply energy threshold and trasform back to global reference + // system + + if ( (hitdestep+deltaDe) > thrde ){ + locals[0] += deltaXl; + locals[2] += deltaZl; + AliITSRecPoint rp; + rp.fTracks[0]=hit->GetTrack(); + // rp.fTracks[0]=mod->GetHitTrackIndex(ihit); + rp.fTracks[1]=-3; + rp.fTracks[2]=-3; + rp.SetX(locals[0]); + rp.SetZ(locals[2]); + rp.SetdEdX(hitdestep+deltaDe); + rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e + rp.SetSigmaX2(sigmarphi*sigmarphi); + rp.SetSigmaZ2(sigmaz*sigmaz); + new (pt[irecp]) AliITSRecPoint(rp); + irecp++; + } // end if ( (hitdestep+deltaDe) + } // end if (hitdestep > 0) + } // end if (flag!=1) + } // end for ihit } //_______________________________________________________________________ void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6]) diff --git a/ITS/AliITSsimulationFastPoints.h b/ITS/AliITSsimulationFastPoints.h index 9ffcb30f6fd..7750692d965 100644 --- a/ITS/AliITSsimulationFastPoints.h +++ b/ITS/AliITSsimulationFastPoints.h @@ -6,6 +6,7 @@ // implements fast simulation ///////////////////////////////////////////////////////// // +class TClonesArray; class AliITSmodule; class TRandom; @@ -15,8 +16,9 @@ class AliITSsimulationFastPoints : public AliITSsimulation public: AliITSsimulationFastPoints(); // default constructor virtual ~AliITSsimulationFastPoints() {;} - void CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm); - void CreateFastRecPoints(Int_t module); + void CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm, + TClonesArray* recp); + void CreateFastRecPoints(Int_t module,TClonesArray* recp); private: diff --git a/ITS/AliITSsimulationFastPointsV0.cxx b/ITS/AliITSsimulationFastPointsV0.cxx index 0d0411edeba..7f6548831bf 100644 --- a/ITS/AliITSsimulationFastPointsV0.cxx +++ b/ITS/AliITSsimulationFastPointsV0.cxx @@ -11,9 +11,14 @@ * 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$ */ +///////////////////////////////////////////////////////// +// fast simulation V0 // +// // +// // +///////////////////////////////////////////////////////// #include "AliITS.h" #include "AliITShit.h" @@ -36,6 +41,20 @@ AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType) fSx = new AliITSstatistics(2); fSz = new AliITSstatistics(2); } +//______________________________________________________________________ +AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const AliITSsimulationFastPointsV0 &/*rec*/):AliITSsimulation(/*rec*/){ + // Copy constructor. + + Error("Copy constructor","Copy constructor not allowed"); + +} +//______________________________________________________________________ +AliITSsimulationFastPointsV0& AliITSsimulationFastPointsV0::operator=(const AliITSsimulationFastPointsV0& /*source*/){ + // Assignment operator. This is a function which is not allowed to be + // done. + Error("operator=","Assignment operator not allowed\n"); + return *this; +} //---------------------------------------------------------- AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0() @@ -47,8 +66,9 @@ AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0() } //------------------------------------------------------------- -void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm) { +void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm, TClonesArray* recp) { // Fast points simulator for all of the ITS. + Int_t nhit,h,trk,ifirst; Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx. Float_t x1,y1,z1; @@ -81,13 +101,13 @@ void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t m // } switch (mod->GetLayer()){ case 1: case 2: // SPDs - AddSPD(e,mod,trk); + AddSPD(e,mod,trk,recp); break; case 3: case 4: // SDDs - AddSDD(e,mod,trk); + AddSDD(e,mod,trk,recp); break; case 5: case 6: // SSDs - AddSSD(e,mod,trk); + AddSSD(e,mod,trk,recp); break; } // end switch fSx->Reset(); @@ -100,9 +120,9 @@ void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t m } //_______________________________________________________________________ void AliITSsimulationFastPointsV0::AddSPD(Float_t &e, - AliITSmodule *mod,Int_t trackNumber){ + AliITSmodule* /*mod*/,Int_t trackNumber,TClonesArray* recp){ // - + TClonesArray &pt=*recp; const Float_t kmicronTocm = 1.0e-4; // const Float_t kdEdXtoQ = ; const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3 @@ -125,13 +145,15 @@ void AliITSsimulationFastPointsV0::AddSPD(Float_t &e, // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2); rpSPD.SetSigmaZ2(a2); - (mod->GetITS())->AddRecPoint(rpSPD); + //(mod->GetITS())->AddRecPoint(rpSPD); + new (pt[fNrecp]) AliITSRecPoint(rpSPD); + fNrecp++; } //_______________________________________________________________________ void AliITSsimulationFastPointsV0::AddSDD(Float_t &e, - AliITSmodule *mod,Int_t trackNumber){ + AliITSmodule* /*mod*/,Int_t trackNumber,TClonesArray* recp){ // - + TClonesArray &pt=*recp; const Float_t kmicronTocm = 1.0e-4; const Float_t kdEdXtoQ = 2.778e+8; const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3 @@ -154,13 +176,15 @@ void AliITSsimulationFastPointsV0::AddSDD(Float_t &e, // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2); rpSDD.SetSigmaZ2(a2); - (mod->GetITS())->AddRecPoint(rpSDD); + new (pt[fNrecp]) AliITSRecPoint(rpSDD); + fNrecp++; + } //_______________________________________________________________________ void AliITSsimulationFastPointsV0::AddSSD(Float_t &e, - AliITSmodule *mod,Int_t trackNumber){ + AliITSmodule* /*mod*/,Int_t trackNumber,TClonesArray* recp){ // - + TClonesArray &pt=*recp; const Float_t kmicronTocm = 1.0e-4; const Float_t kdEdXtoQ = 2.778e+8; const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3 @@ -183,7 +207,10 @@ void AliITSsimulationFastPointsV0::AddSSD(Float_t &e, // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS()); rpSSD.SetSigmaZ2(a2); - (mod->GetITS())->AddRecPoint(rpSSD); + new (pt[fNrecp]) AliITSRecPoint(rpSSD); + fNrecp++; + + } //_______________________________________________________________________ diff --git a/ITS/AliITSsimulationFastPointsV0.h b/ITS/AliITSsimulationFastPointsV0.h index e6b4ca012c2..694b8a5b14b 100644 --- a/ITS/AliITSsimulationFastPointsV0.h +++ b/ITS/AliITSsimulationFastPointsV0.h @@ -8,6 +8,7 @@ class AliITSmodule; class AliITSstatistics; class TRandom; +class TClonesArray; class AliITSsimulationFastPointsV0 : public AliITSsimulation { @@ -15,24 +16,27 @@ class AliITSsimulationFastPointsV0 : public AliITSsimulation public: AliITSsimulationFastPointsV0(); // default constructor AliITSsimulationFastPointsV0(const char *dataType); // standard constructor - virtual ~AliITSsimulationFastPointsV0(); - void CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm); -private: + AliITSsimulationFastPointsV0(const AliITSsimulationFastPointsV0 &); + AliITSsimulationFastPointsV0 & operator=(const AliITSsimulationFastPointsV0 &); virtual AliITSsimulation& operator=(const AliITSsimulation &) {return *this;}; - AliITSsimulationFastPointsV0(const AliITSsimulationFastPointsV0 &); - AliITSsimulationFastPointsV0 & operator=(const AliITSsimulationFastPointsV0 &) - { return *this;} - void AddSPD(Float_t &e,AliITSmodule *mod,Int_t trackNumber); - void AddSDD(Float_t &e,AliITSmodule *mod,Int_t trackNumber); - void AddSSD(Float_t &e,AliITSmodule *mod,Int_t trackNumber); + + virtual ~AliITSsimulationFastPointsV0(); + void CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm, + TClonesArray* recp); +private: + + void AddSPD(Float_t &e,AliITSmodule *mod,Int_t trackNumber,TClonesArray* recp); + void AddSDD(Float_t &e,AliITSmodule *mod,Int_t trackNumber,TClonesArray* recp); + void AddSSD(Float_t &e,AliITSmodule *mod,Int_t trackNumber,TClonesArray* recp); private: + Int_t fNrecp; //current number of fast point AliITSstatistics *fSx; // pointer to AliITSstatistics class AliITSstatistics *fSz; // pointer to AliITSstatistics class - ClassDef(AliITSsimulationFastPointsV0,1) // Fast point simulator. + ClassDef(AliITSsimulationFastPointsV0,2) // Fast point simulator. }; diff --git a/ITS/AliITSsimulationSPD.cxx b/ITS/AliITSsimulationSPD.cxx index 57f2badd140..42855d9178a 100644 --- a/ITS/AliITSsimulationSPD.cxx +++ b/ITS/AliITSsimulationSPD.cxx @@ -15,16 +15,12 @@ /* $Id$ */ -#include #include #include -#include #include -#include #include "AliRun.h" #include "AliITS.h" -#include "AliITShit.h" #include "AliITSdigitSPD.h" #include "AliITSmodule.h" #include "AliITSMapA2.h" @@ -32,8 +28,6 @@ #include "AliITSsimulationSPD.h" #include "AliITSsegmentation.h" #include "AliITSresponse.h" -#include "AliITSsegmentationSPD.h" -#include "AliITSresponseSPD.h" #include "AliLog.h" //#define DEBUG diff --git a/ITS/AliITSsimulationSPD.h b/ITS/AliITSsimulationSPD.h index d13b251d137..222384ace87 100644 --- a/ITS/AliITSsimulationSPD.h +++ b/ITS/AliITSsimulationSPD.h @@ -6,6 +6,15 @@ /* $Id$ */ +//////////////////////////////////////////////////////////////////////// +// Version: 0 // +// Written by Rocco Caliandro // +// from a model developed with T. Virgili and R.A. Fini // +// June 15 2000 // +// // +// AliITSsimulationSPD is the simulation of SPDs // +//////////////////////////////////////////////////////////////////////// + #include "AliITSresponseSPD.h" #include "AliITSsegmentationSPD.h" #include "AliITSsimulation.h" @@ -22,7 +31,7 @@ class AliITSsimulationSPD : public AliITSsimulation { AliITSsimulationSPD(); // Default constructor // Standard constructor AliITSsimulationSPD(AliITSsegmentation *seg, AliITSresponse *res); - ~AliITSsimulationSPD();// destructor + virtual ~AliITSsimulationSPD();// destructor AliITSsimulationSPD(const AliITSsimulationSPD &source); // copy constructo // assignment operator AliITSsimulationSPD& operator=(const AliITSsimulationSPD &source); diff --git a/ITS/AliITStrackSA.cxx b/ITS/AliITStrackSA.cxx index a0512e4422b..52eb40ba5ec 100755 --- a/ITS/AliITStrackSA.cxx +++ b/ITS/AliITStrackSA.cxx @@ -23,8 +23,6 @@ // of cluster equal to fgkMaxNumberOfClusters // //////////////////////////////////////////////////// -#include "AliRun.h" -#include "AliITS.h" #include "AliITSgeom.h" #include "AliITStrackSA.h" @@ -52,6 +50,7 @@ AliITStrackSA::AliITStrackSA(const AliITStrackSA& t) : AliITStrackMI(t){ // Copy constructor + ResetIndexSA(); Int_t number = t.GetNumberOfClustersSA(); SetNumberOfClustersSA(number); @@ -61,14 +60,9 @@ AliITStrackMI(t){ } //____________________________________________________ -AliITStrackSA::AliITStrackSA(Int_t layer, Int_t ladder, Int_t detector, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ) { +AliITStrackSA::AliITStrackSA(AliITSgeom* geom,Int_t layer, Int_t ladder, Int_t detector, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ) { // standard constructor. Used for ITS standalone tracking - AliITS* iTS = (AliITS*)gAlice->GetDetector("ITS"); - if(!iTS){ - Fatal("AliITStrackSA","ITS object not found - Abort\n"); - return; - } - AliITSgeom *geom = iTS->GetITSgeom(); + if(!geom){ Fatal("AliITStrackSA","ITS geometry not found - Abort\n"); return; @@ -129,6 +123,7 @@ AliITStrackSA::AliITStrackSA(Int_t layer, Int_t ladder, Int_t detector, Double_t SetMass(0.139); // pion mass SetLabel(lab); + } //____________________________________________________________ diff --git a/ITS/AliITStrackSA.h b/ITS/AliITStrackSA.h index 2a4c8b6286b..240feb408c9 100755 --- a/ITS/AliITStrackSA.h +++ b/ITS/AliITStrackSA.h @@ -19,7 +19,7 @@ class AliITStrackSA : public AliITStrackMI { AliITStrackSA(); AliITStrackSA(const AliITStrackMI& t); AliITStrackSA(const AliITStrackSA& t); - AliITStrackSA(Int_t layer, Int_t ladder, Int_t detector, + AliITStrackSA(AliITSgeom* geom,Int_t layer, Int_t ladder, Int_t detector, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab); diff --git a/ITS/AliITStrackerANN.cxx b/ITS/AliITStrackerANN.cxx index 4f11a63a788..35843506edc 100644 --- a/ITS/AliITStrackerANN.cxx +++ b/ITS/AliITStrackerANN.cxx @@ -18,8 +18,6 @@ // Email : alberto.pulvirenti@ct.infn.it // --------------------------------------------------------------------------------- -#include -#include #include #include #include @@ -1442,7 +1440,7 @@ Int_t AliITStrackerANN::SaveTracks(Int_t sector) fGeom->GetModuleId(mod, lay, lad, det); Float_t y0 = cluster->GetY(); Float_t z0 = cluster->GetZ(); - AliITStrackSA* trac = new AliITStrackSA(lay, lad, det, + AliITStrackSA* trac = new AliITStrackSA(fGeom,lay, lad, det, y0, z0, param[4], param[7], param[3], 1); for (l = 0; l < fNLayers; l++) { @@ -1606,7 +1604,7 @@ Int_t AliITStrackerANN::StoreTracks() fGeom->GetModuleId(mod, lay, lad, det); Float_t y0 = cluster->GetY(); Float_t z0 = cluster->GetZ(); - AliITStrackSA* trac = new AliITStrackSA(lay, lad, det, y0, z0, + AliITStrackSA* trac = new AliITStrackSA(fGeom,lay, lad, det, y0, z0, annTrack.Phi(), annTrack.TanLambda(), annTrack.Curv(), 1); for (Int_t l = 0; l < fNLayers; l++) { diff --git a/ITS/AliITStrackerSA.cxx b/ITS/AliITStrackerSA.cxx index 6d061c78966..6dbcceb06a0 100644 --- a/ITS/AliITStrackerSA.cxx +++ b/ITS/AliITStrackerSA.cxx @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -81,7 +80,7 @@ AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliITSVertexer *vertexer):Ali } //____________________________________________________________________________ -AliITStrackerSA::AliITStrackerSA(AliITStrackerSA& tracker):AliITStrackerMI(){ +AliITStrackerSA::AliITStrackerSA(const AliITStrackerSA& tracker):AliITStrackerMI(){ // Copy constructor fPhiEstimate = tracker.fPhiEstimate; for(Int_t i=0;i<2;i++){ @@ -109,6 +108,13 @@ AliITStrackerSA::AliITStrackerSA(AliITStrackerSA& tracker):AliITStrackerMI(){ fTable = tracker.fTable; fListOfTracks = tracker.fListOfTracks; } +//______________________________________________________________________ +AliITStrackerSA& AliITStrackerSA::operator=(const AliITStrackerSA& /*source*/){ + // Assignment operator. This is a function which is not allowed to be + // done. + Error("operator=","Assignment operator not allowed\n"); + return *this; +} //____________________________________________________________________________ AliITStrackerSA::~AliITStrackerSA(){ @@ -427,14 +433,12 @@ Int_t AliITStrackerSA::FindTracks(AliESD* event){ errorsprimvert[0]=0.005; errorsprimvert[1]=0.005; } - //Fill array with cluster indices for each module if(!fTable){ fTable = new AliITSclusterTable(fGeom,this,primaryVertex); fTable->FillArray(fITSclusters); fTable->FillArrayCoorAngles(); } - Int_t * firstmod = new Int_t[fGeom->GetNlayers()]; for(Int_t i=0;iGetNlayers();i++){ firstmod[i]=fGeom->GetModuleIndex(i+1,1,1); @@ -793,7 +797,7 @@ AliITStrackV2* AliITStrackerSA::FitTrack(AliITStrackSA* tr,Double_t *primaryVert AliITSclusterV2* cl4 = (AliITSclusterV2*)listlayer[4]->At(l5); for(Int_t l6=0;l6At(l6); - AliITStrackSA* trac = new AliITStrackSA(layer,ladder,detector,yclu1,zclu1,phi,tgl,cv,1); + AliITStrackSA* trac = new AliITStrackSA(fGeom,layer,ladder,detector,yclu1,zclu1,phi,tgl,cv,1); if(cl5!=0) trac->AddClusterV2(5,(clind5[l6] & 0x0fffffff)>>0); if(cl4!=0) trac->AddClusterV2(4,(clind4[l5] & 0x0fffffff)>>0); diff --git a/ITS/AliITStrackerSA.h b/ITS/AliITStrackerSA.h index 5ed8eb51c54..f4a5efff6af 100644 --- a/ITS/AliITStrackerSA.h +++ b/ITS/AliITStrackerSA.h @@ -29,7 +29,8 @@ class AliITStrackerSA : public AliITStrackerMI { AliITStrackerSA(AliITSgeom *geom); AliITStrackerSA(AliITSgeom *geom,AliESDVertex *vert); AliITStrackerSA(AliITSgeom *geom,AliITSVertexer *vertexer); - AliITStrackerSA(AliITStrackerSA& tracker); + AliITStrackerSA(const AliITStrackerSA& tracker); + AliITStrackerSA& operator=(const AliITStrackerSA& /* trkr */); virtual ~AliITStrackerSA(); virtual Int_t Clusters2Tracks(AliESD *event){Int_t rc = AliITStrackerMI::Clusters2Tracks(event); if(!rc) rc=FindTracks(event); return rc;} Int_t FindTracks(AliESD* event); @@ -51,11 +52,6 @@ class AliITStrackerSA : public AliITStrackerMI { protected: - // copy constructor (NO copy allowed: the constructor is protected - // to avoid misuse) - AliITStrackerSA(const AliITStrackerSA& trkr); - // assignment operator (NO assignment allowed) - AliITStrackerSA& operator=(const AliITStrackerSA& /* trkr */); //Initialization void Init(); void ResetForFinding(); diff --git a/ITS/AliITSvBeamTestITS04.cxx b/ITS/AliITSvBeamTestITS04.cxx index dd95388fc7b..4ac11f9a80f 100644 --- a/ITS/AliITSvBeamTestITS04.cxx +++ b/ITS/AliITSvBeamTestITS04.cxx @@ -5,16 +5,10 @@ //////////////////////////////////////////////////////// #include "AliRun.h" #include "AliITSvBeamTestITS04.h" -#include #include #include -#include #include "AliITS.h" -#include "AliITSDetType.h" -#include "AliITSLoader.h" -#include "AliITSdigitSPD.h" -#include "AliITSdigitSDD.h" -#include "AliITSdigitSSD.h" +#include "AliITSDetTypeSim.h" #include "AliITSgeom.h" #include "AliITShit.h" #include "AliITSresponseSDD.h" @@ -30,7 +24,6 @@ const Int_t AliITSvBeamTestITS04::fgkNumberOfSPD = 4; const Int_t AliITSvBeamTestITS04::fgkNumberOfSDD = 2; const Int_t AliITSvBeamTestITS04::fgkNumberOfSSD = 4; - // Dimension (thickness:Y (beam direction), width:X, length:Z) const char* AliITSvBeamTestITS04::fgSPDsensitiveVolName = "ITSspdSensitiv"; @@ -73,11 +66,10 @@ const Double_t AliITSvBeamTestITS04::fgkSSD1y = 80.6; //=============================================================== -#include #include #include "AliTrackReference.h" -#include "AliITSDetType.h" +#include "AliITSDetTypeSim.h" #include "AliITSgeom.h" #include "AliITSgeomSDD.h" #include "AliITSgeomSPD.h" @@ -293,21 +285,21 @@ void AliITSvBeamTestITS04::InitAliITSgeom() nlad[5] = 1; ndet[5] = 2; Int_t nModTot = fNspd + fNsdd + fNssd; - if (fITSgeom) delete fITSgeom; - fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,nModTot); - + if (GetITSgeom()) SetITSgeom(0x0); + AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,nModTot); + SetITSgeom(geom); //*** Set default shapes const Float_t kDxyzSPD[] = {fgkSPDwidthSens/2, fgkSPDthickSens/2,fgkSPDlengthSens/2}; - if(!(fITSgeom->IsShapeDefined(kSPD))) - fITSgeom->ReSetShape(kSPD,new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD)); + if(!(GetITSgeom()->IsShapeDefined(kSPD))) + GetITSgeom()->ReSetShape(kSPD,new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD)); const Float_t kDxyzSDD[] = {fgkSDDwidthSens/2., fgkSDDthickSens/2.,fgkSDDlengthSens/2.}; - if(!(fITSgeom->IsShapeDefined(kSDD))) - fITSgeom->ReSetShape(kSDD, new AliITSgeomSDD256(3,(Float_t *)kDxyzSDD)); + if(!(GetITSgeom()->IsShapeDefined(kSDD))) + GetITSgeom()->ReSetShape(kSDD, new AliITSgeomSDD256(3,(Float_t *)kDxyzSDD)); const Float_t kDxyzSSD[] = {fgkSSDlengthSens/2, fgkSSDthickSens/2,fgkSSDwidthSens/2}; - if(!(fITSgeom->IsShapeDefined(kSSD))) - fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD)); + if(!(GetITSgeom()->IsShapeDefined(kSSD))) + GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD)); // Creating the matrices in AliITSgeom for each sensitive volume // (like in AliITSv11GeometrySDD) mln @@ -332,7 +324,7 @@ void AliITSvBeamTestITS04::InitAliITSgeom() Int_t iLad = 1; Int_t iLay = 1; if (i+1>2) iLay = 2; - fITSgeom->CreatMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot); + GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot); startMod++; }; }; @@ -351,7 +343,7 @@ void AliITSvBeamTestITS04::InitAliITSgeom() Int_t iDet = 1; Int_t iLad = 1; Int_t iLay = fNspd-1+i; - fITSgeom->CreatMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot); + GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot); startMod++; }; }; @@ -372,7 +364,7 @@ void AliITSvBeamTestITS04::InitAliITSgeom() Int_t iLad = 1; Int_t iLay = 5; if (i+1>2) iLay = 6; - fITSgeom->CreatMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot); + GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot); startMod++; }; }; @@ -387,7 +379,11 @@ void AliITSvBeamTestITS04::SetDefaults() const Float_t kconv = 1.0e+04; // convert cm to microns - AliITSDetType *iDetType; + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + fDetTypeSim->SetITSgeom(GetITSgeom()); + fDetTypeSim->ResetResponse(); + fDetTypeSim->ResetSegmentation(); + AliITSgeomSPD *s0; AliITSgeomSDD *s1; AliITSgeomSSD *s2; @@ -396,20 +392,29 @@ void AliITSvBeamTestITS04::SetDefaults() // If fGeomDetIn is set true the geometry will // be initialised from file (JC) - if(fITSgeom!=0) delete fITSgeom; - fITSgeom = new AliITSgeom(); - if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); + if(GetITSgeom()!=0) SetITSgeom(0x0); + AliITSgeom* geom = new AliITSgeom(); + SetITSgeom(geom); + if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); if(!fGeomDetIn) this->InitAliITSgeom(); - if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); + if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); // SPD - iDetType=DetType(kSPD); - s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD);// Get shape info. + + s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. if (s0) { - AliITSresponse *resp0=new AliITSresponseSPD(); - SetResponseModel(kSPD,resp0); - AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom); + AliITSresponse *resp0=0; + Int_t nspd=0; + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSPD){ + resp0 = new AliITSresponseSPD(); + SetResponseModel(nmod,resp0); + nspd=nmod; + } + } + + AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom()); seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD s0->GetDz()*2.*kconv, // for now. s0->GetDy()*2.*kconv);// x,z,y full width in microns. @@ -425,53 +430,68 @@ void AliITSvBeamTestITS04::SetDefaults() seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. SetSegmentationModel(kSPD,seg0); // set digit and raw cluster classes to be used - const char *kData0=(iDetType->GetResponseModel())->DataType(); + const char *kData0=(fDetTypeSim->GetResponseModel(nspd))->DataType(); if (strstr(kData0,"real")) - iDetType->ClassNames("AliITSdigit","AliITSRawClusterSPD"); - else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD"); - }; + fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); + } // SDD - iDetType=DetType(kSDD); - s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD);// Get shape info. + + s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. if (s1) { - AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated"); - SetResponseModel(kSDD,resp1); - AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1); + AliITSresponseSDD *resp1=0; + Int_t nsdd=0; + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSDD){ + resp1 = new AliITSresponseSDD("simulated"); + SetResponseModel(nmod,resp1); + nsdd=nmod; + } + } + AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1); seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD s1->GetDz()*4.*kconv, // for now. s1->GetDy()*4.*kconv); // x,z,y full width in microns. seg1->SetNPads(256,256);// Use AliITSgeomSDD for now SetSegmentationModel(kSDD,seg1); - const char *kData1=(iDetType->GetResponseModel())->DataType(); - const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption(); + const char *kData1=(fDetTypeSim->GetResponseModel(nsdd))->DataType(); + const char *kopt=fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD())->ZeroSuppOption(); if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){ - iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD"); - } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD"); - }; + fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit"); + } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD"); + } // SSD - iDetType=DetType(kSSD); - s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now. + + s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now. if (s2) { - AliITSresponse *resp2=new AliITSresponseSSD("simulated"); - SetResponseModel(kSSD,resp2); - AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom); - seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD - s2->GetDz()*2.*kconv, // for now. - s2->GetDy()*2.*kconv); // x,z,y full width in microns. - seg2->SetPadSize(95.,0.); // strip x pitch in microns - seg2->SetNPads(768,0); // number of strips on each side. - 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(kSSD,seg2); - const char *kData2=(iDetType->GetResponseModel())->DataType(); - if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit","AliITSRawClusterSSD"); - else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD"); - }; - - if(kNTYPES>3){Warning("SetDefaults","Only the four basic detector types are initialised!");} + AliITSresponse *resp2=0; + Int_t nssd=0; + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSSD){ + resp2 = new AliITSresponseSSD("simulated"); + SetResponseModel(nmod,resp2); + nssd=nmod; + } + } + + AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom()); + seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD + s2->GetDz()*2.*kconv, // for now. + s2->GetDy()*2.*kconv); // x,z,y full width in microns. + seg2->SetPadSize(95.,0.); // strip x pitch in microns + seg2->SetNPads(768,0); // number of strips on each side. + 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(kSSD,seg2); + const char *kData2=(fDetTypeSim->GetResponseModel(nssd))->DataType(); + if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD"); + } + + if(fgkNTYPES>3){Warning("SetDefaults","Only the four basic detector types are initialised!");} return; } diff --git a/ITS/AliITSvBeamTestITS04.h b/ITS/AliITSvBeamTestITS04.h index b9854445f5c..1166a113371 100644 --- a/ITS/AliITSvBeamTestITS04.h +++ b/ITS/AliITSvBeamTestITS04.h @@ -1,5 +1,5 @@ -#ifndef ALIITSVITS04_H -#define ALIITSVITS04_H +#ifndef ALIITSVBEAMTESTITS04_H +#define ALIITSVBEAMTESTITS04_H //////////////////////////////////////////////// // ITS geometry class and step manager for the// diff --git a/ITS/AliITSvPPRasymmFMD.cxx b/ITS/AliITSvPPRasymmFMD.cxx index 83bef2c2b0c..e1e78650099 100644 --- a/ITS/AliITSvPPRasymmFMD.cxx +++ b/ITS/AliITSvPPRasymmFMD.cxx @@ -29,16 +29,14 @@ // See AliITSvPPRasymmFMD::StepManager(). -#include #include #include #include -#include #include #include #include "AliITS.h" -#include "AliITSDetType.h" +#include "AliITSDetTypeSim.h" #include "AliITSGeant3Geometry.h" #include "AliITSgeom.h" #include "AliITSgeomSDD.h" @@ -58,6 +56,7 @@ #include "AliRun.h" #include "AliTrackReference.h" + #define GEANTGEOMETRY kTRUE ClassImp(AliITSvPPRasymmFMD) @@ -5065,10 +5064,11 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){ mod += k; } // end for i - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38; ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25; - fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod); + AliITSgeom* geom = new AliITSgeom(0,6,nlad,ndet,mod); + SetITSgeom(geom); mod = -1; for(lay=1;lay<=knlayers;lay++){ for(j=0;jGetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt, par,att,imat,imed); - fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r); - if(!(fITSgeom->IsShapeDefined((Int_t)kSPD))) - fITSgeom->ReSetShape(kSPD, + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r); + if(!(GetITSgeom()->IsShapeDefined((Int_t)kSPD))) + GetITSgeom()->ReSetShape(kSPD, new AliITSgeomSPD425Short(npar,par)); } // end for det } // end for k @@ -5105,21 +5105,21 @@ void AliITSvPPRasymmFMD::InitAliITSgeom(){ par,att,imat,imed); switch (lay){ case 3: case 4: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r); - if(!(fITSgeom->IsShapeDefined(kSDD))) - fITSgeom->ReSetShape(kSDD, + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSDD,t,r); + if(!(GetITSgeom()->IsShapeDefined(kSDD))) + GetITSgeom()->ReSetShape(kSDD, new AliITSgeomSDD256(npar,par)); break; case 5: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); - if(!(fITSgeom->IsShapeDefined(kSSD))) - fITSgeom->ReSetShape(kSSD, + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + if(!(GetITSgeom()->IsShapeDefined(kSSD))) + GetITSgeom()->ReSetShape(kSSD, new AliITSgeomSSD275and75(npar,par)); break; case 6: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); - if(!(fITSgeom->IsShapeDefined(kSSD))) - fITSgeom->ReSetShape(kSSD, + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + if(!(GetITSgeom()->IsShapeDefined(kSSD))) + GetITSgeom()->ReSetShape(kSSD, new AliITSgeomSSD75and275(npar,par)); break; } // end switch @@ -5145,11 +5145,12 @@ void AliITSvPPRasymmFMD::Init(){ // if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); - if(fITSgeom!=0) delete fITSgeom; - fITSgeom = new AliITSgeom(); - if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); + if(GetITSgeom()!=0) SetITSgeom(0x0); + AliITSgeom* geom = new AliITSgeom(); + SetITSgeom(geom); + if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); else this->InitAliITSgeom(); - if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); + if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); AliITS::Init(); // fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID. @@ -5163,23 +5164,29 @@ void AliITSvPPRasymmFMD::SetDefaults(){ // none. // Return: // none. + const Float_t kconv = 1.0e+04; // convert cm to microns - AliInfo("Called"); + AliInfo("Called"); - AliITSDetType *iDetType; + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + fDetTypeSim->SetITSgeom(GetITSgeom()); AliITSgeomSPD *s0; AliITSgeomSDD *s1; AliITSgeomSSD *s2; Int_t i; Float_t bx[256],bz[280]; - + + fDetTypeSim->ResetResponse(); + fDetTypeSim->ResetSegmentation(); //SPD - iDetType=DetType(kSPD); - s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD);// Get shape info. Do it this way for now. - AliITSresponse *resp0=new AliITSresponseSPD(); - SetResponseModel(kSPD,resp0); - AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom); + s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now. + AliITSresponseSPD* resp0=0; + for(Int_t nspd=GetITSgeom()->GetStartSPD();nspd<=GetITSgeom()->GetLastSPD();nspd++){ + resp0 = new AliITSresponseSPD(); + SetResponseModel(nspd,resp0); + } + AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom()); seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD s0->GetDz()*2.*kconv, // for now. s0->GetDy()*2.*kconv); // x,z,y full width in microns. @@ -5195,38 +5202,36 @@ void AliITSvPPRasymmFMD::SetDefaults(){ seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. SetSegmentationModel(kSPD,seg0); // 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"); -// SetSimulationModel(kSPD,new AliITSsimulationSPD(seg0,resp0)); -// iDetType->ReconstructionModel(new AliITSClusterFinderSPD()); + const char *kData0=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD()))->DataType(); + if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); // SDD - iDetType=DetType(kSDD); - s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD);// Get shape info. Do it this way for now. - AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated"); - SetResponseModel(kSDD,resp1); - AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1); + s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now. + AliITSresponseSDD* resp1=0; + for(Int_t nsdd=GetITSgeom()->GetStartSDD();nsdd<=GetITSgeom()->GetLastSDD();nsdd++){ + resp1 = new AliITSresponseSDD("simulated"); + SetResponseModel(nsdd,resp1); + } + + AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1); seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD s1->GetDz()*2.*kconv, // for now. s1->GetDy()*2.*kconv); // x,z,y full width in microns. seg1->SetNPads(256,256);// Use AliITSgeomSDD for now SetSegmentationModel(kSDD,seg1); - const char *kData1=(iDetType->GetResponseModel())->DataType(); - const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption(); + const char *kData1=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD()))->DataType(); + const char *kopt=fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD())->ZeroSuppOption(); if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){ - iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD"); - } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD"); -// SetSimulationModel(kSDD,new AliITSsimulationSDD(seg1,resp1)); -// iDetType->ReconstructionModel(new AliITSClusterFinderSDD()); - + fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit"); + } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD"); // SSD Layer 5 - iDetType=DetType(kSSD); - s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now. - AliITSresponse *resp2=new AliITSresponseSSD("simulated"); - SetResponseModel(kSSD,resp2); - AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom); + s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now. + for(Int_t nssd=GetITSgeom()->GetStartSSD();nssd<=GetITSgeom()->GetLastSSD();nssd++){ + SetResponseModel(nssd,new AliITSresponseSSD("simulated")); + } + + AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom()); seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD s2->GetDz()*2.*kconv, // for now. s2->GetDy()*2.*kconv); // x,z,y full width in microns. @@ -5236,17 +5241,14 @@ void AliITSvPPRasymmFMD::SetDefaults(){ 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(kSSD,seg2); - const char *kData2=(iDetType->GetResponseModel())->DataType(); - if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit", - "AliITSRawClusterSSD"); - else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD"); -// SetSimulationModel(kSSD,new AliITSsimulationSSD(seg2,resp2)); -// iDetType->ReconstructionModel(new AliITSClusterFinderSSD()); - - if(kNTYPES>3){ + const char *kData2=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD()))->DataType(); + if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD"); + if(fgkNTYPES>3){ Warning("SetDefaults", "Only the four basic detector types are initialised!"); }// end if + return; } //______________________________________________________________________ diff --git a/ITS/AliITSvSDD03.cxx b/ITS/AliITSvSDD03.cxx index d7e5ec38da8..fdfa46b890e 100644 --- a/ITS/AliITSvSDD03.cxx +++ b/ITS/AliITSvSDD03.cxx @@ -21,8 +21,7 @@ // // // // ///////////////////////////////////////////////////////////////// -#include -#include + #include #include #include @@ -38,10 +37,9 @@ #include "AliITS.h" #include "AliITSvSDD03.h" #include "AliITSgeom.h" -#include "AliITSgeomSPD.h" #include "AliITSgeomSDD.h" #include "AliITSgeomSSD.h" -#include "AliITSDetType.h" +#include "AliITSDetTypeSim.h" #include "AliITSresponseSPD.h" #include "AliITSresponseSDD.h" #include "AliITSresponseSSD.h" @@ -52,6 +50,7 @@ #include "AliITSsimulationSDD.h" #include "AliITSsimulationSSD.h" + ClassImp(AliITSvSDD03) //______________________________________________________________________ @@ -719,7 +718,7 @@ void AliITSvSDD03::InitAliITSgeom(){ Info("InitAliITSgeom","Reading geometry transformation directly from Geant 3"); const Int_t knp=384; const Float_t kpitch=50.E-4;/*cm*/ - Float_t box[3]={0.5*kpitch*(Float_t)knp,150.E-4,1.0},p[knp+2],n[knp+2]; + Float_t box[3]={0.5*kpitch*(Float_t)knp,150.E-4,1.0},p[knp+1],n[knp+1]; const Int_t kltypess = 2; const Int_t knlayers = 12; const Int_t kndeep = 6; @@ -755,11 +754,13 @@ void AliITSvSDD03::InitAliITSgeom(){ strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4); // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]); mod = knlayers; - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); for(Int_t iMod=0; iModCreatMatrix(mod,lay,lad,det,kSDD,t,r); - if(!(fITSgeom->IsShapeDefined((Int_t)kSDD))){ - fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD256(npar,par)); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSDD,t,r); + if(!(GetITSgeom()->IsShapeDefined((Int_t)kSDD))){ + GetITSgeom()->ReSetShape(kSDD,new AliITSgeomSDD256(npar,par)); } // end if break; case 1: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); - if(!(fITSgeom->IsShapeDefined((Int_t)kSSD))){ - fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0, + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD))){ + GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0, knp+1,p,knp+1,n)); } // end if break; @@ -815,11 +816,12 @@ void AliITSvSDD03::Init(){ if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); - if(fITSgeom!=0) delete fITSgeom; - fITSgeom = new AliITSgeom(); - if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); + if(GetITSgeom()!=0) SetITSgeom(0x0); + AliITSgeom* geom = new AliITSgeom(); + SetITSgeom(geom); + if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); if(!fGeomDetIn) this->InitAliITSgeom(); - if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); + if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); AliITS::Init(); fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID. @@ -836,43 +838,63 @@ void AliITSvSDD03::SetDefaults(){ const Float_t kconv = 1.0e+04; // convert cm to microns - Info("SetDefaults","Setting up only SDD detector"); - - AliITSDetType *iDetType; + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + fDetTypeSim->SetITSgeom(GetITSgeom()); + fDetTypeSim->ResetResponse(); + fDetTypeSim->ResetSegmentation(); + AliITSgeomSDD *s1; AliITSgeomSSD *s2; - iDetType=DetType(kSPD); - SetResponseModel(kSPD,new AliITSresponseSPD()); + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSPD)SetResponseModel(nmod,new AliITSresponseSPD()); + } + SetSegmentationModel(kSPD,new AliITSsegmentationSPD()); - const char *kData0=(iDetType->GetResponseModel())->DataType(); - if(strstr(kData0,"real") ) iDetType->ClassNames("AliITSdigit", - "AliITSRawClusterSPD"); - else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD"); + fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); // SDD - iDetType=DetType(kSDD); - s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD);// Get shape info. Do it this way for now. - AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated"); - SetResponseModel(kSDD,resp1); - AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1); + s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now. + AliITSresponseSDD *resp1=0; + Int_t nsdd=0; + + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSDD){ + resp1 = new AliITSresponseSDD("simulated"); + SetResponseModel(nmod,resp1); + nsdd=nmod; + } + } + + + AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1); seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD s1->GetDz()*2.*kconv, // for now. s1->GetDy()*2.*kconv); // x,z,y full width in microns. seg1->SetNPads(256,256);// Use AliITSgeomSDD for now SetSegmentationModel(kSDD,seg1); - const char *kData1=(iDetType->GetResponseModel())->DataType(); - const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption(); + const char *kData1=(fDetTypeSim->GetResponseModel(nsdd))->DataType(); + const char *kopt=fDetTypeSim->GetResponseModel(nsdd)->ZeroSuppOption(); if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){ - iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD"); - } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD"); + fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit"); + } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD"); // SSD Layer 5 - iDetType=DetType(kSSD); - s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now. - AliITSresponse *resp2=new AliITSresponseSSD("simulated"); - SetResponseModel(kSSD,resp2); - AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom); + + s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now. + + AliITSresponse *resp2=0; + Int_t nssd=0; + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSSD){ + resp2 = new AliITSresponseSSD("simulated"); + SetResponseModel(nmod,resp2); + nssd=nmod; + } + } + + + AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom()); seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD s2->GetDz()*2.*kconv, // for now. s2->GetDy()*2.*kconv); // x,z,y full width in microns. @@ -884,12 +906,11 @@ void AliITSvSDD03::SetDefaults(){ seg2->SetAnglesLay6(0.,0.); // strip angles rad P and N side. SetSegmentationModel(kSSD,seg2); - const char *kData2=(iDetType->GetResponseModel())->DataType(); - if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit", - "AliITSRawClusterSSD"); - else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD"); + const char *kData2=(fDetTypeSim->GetResponseModel(nsdd))->DataType(); + if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD"); - if(kNTYPES>3){ + if(fgkNTYPES>3){ Warning("SetDefaults", "Only the four basic detector types are initialised!"); }// end if @@ -905,48 +926,63 @@ void AliITSvSDD03::SetDefaultSimulation(){ // Return: // none. - AliITSDetType *iDetType; - AliITSsimulation *sim; - AliITSsegmentation *seg; - AliITSresponse *res; - iDetType = DetType(kSPD); - if(iDetType){ - sim = iDetType->GetSimulationModel(); - if (!sim) { - seg =(AliITSsegmentation*)iDetType->GetSegmentationModel(); - if(seg==0) seg = new AliITSsegmentationSPD(); - res = (AliITSresponse*)iDetType->GetResponseModel(); - if(res==0) res = new AliITSresponseSPD(); - sim = new AliITSsimulationSPDdubna(seg,res,0); - SetSimulationModel(kSPD,sim); - }else{ // simulation exists, make sure it is set up properly. - 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. - 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. - sim->Init(); - } // end if - } // end if iDetType + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + AliITSsimulation *sim; + AliITSsegmentation *seg; + AliITSresponse *res; + Int_t nspd =0; + Int_t nsdd =0; + Int_t nssd =0; + for(Int_t i=0;iGetIndexMax();i++){ + if(GetITSgeom()->GetModuleType(i)==kSPD) nspd=i; + if(GetITSgeom()->GetModuleType(i)==kSDD) nsdd=i; + if(GetITSgeom()->GetModuleType(i)==kSSD) nssd=i; + } + //SPD + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSPD); + if (!sim) { + seg =(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD); + if(seg==0) seg = new AliITSsegmentationSPD(); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nspd); + if(res==0) res = new AliITSresponseSPD(); + sim = new AliITSsimulationSPDdubna(seg,res,0); + SetSimulationModel(kSPD,sim); + }else{ // simulation exists, make sure it is set up properly. + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD)); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nspd)); + sim->Init(); + } // end if + } // end if iDetType + //SDD + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSDD); + if (!sim) { + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd); + sim = new AliITSsimulationSDD(seg,res); + SetSimulationModel(kSDD,sim); + }else{ // simulation exists, make sure it is set up properly. + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD)); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd)); + + sim->Init(); + } //end if + } // end if iDetType + //SSD + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSSD); + if (!sim) { + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd); + sim = new AliITSsimulationSSD(seg,res); + SetSimulationModel(kSSD,sim); + }else{ // simulation exists, make sure it is set up properly. + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD)); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nssd)); + sim->Init(); + } // end if + } // end if iDetType } //______________________________________________________________________ void AliITSvSDD03::DrawModule() const{ diff --git a/ITS/AliITSvSPD02.cxx b/ITS/AliITSvSPD02.cxx index 01e4d100c79..f8622659ecb 100644 --- a/ITS/AliITSvSPD02.cxx +++ b/ITS/AliITSvSPD02.cxx @@ -15,8 +15,6 @@ /* $Id$ */ -#include -#include #include #include #include @@ -32,19 +30,13 @@ #include "AliITSvSPD02.h" #include "AliITSgeom.h" #include "AliITSgeomSPD.h" -#include "AliITSgeomSSD.h" -#include "AliITSDetType.h" +#include "AliITSDetTypeSim.h" #include "AliITSresponseSPD.h" -#include "AliITSresponseSDD.h" -#include "AliITSresponseSSD.h" #include "AliITSsegmentationSPD.h" -#include "AliITSsegmentationSDD.h" -#include "AliITSsegmentationSSD.h" #include "AliITSsimulationSPDdubna.h" -#include "AliITSsimulationSDD.h" -#include "AliITSsimulationSSD.h" #include "AliMC.h" + /////////////////////////////////////////////////////////////////////// // Step manager and // geometry class @@ -583,10 +575,11 @@ void AliITSvSPD02::InitAliITSgeom(){ Int_t mod=0,typ=0,lay=0,lad=0,det=0,cpy=0,i=0,j=0,k=0; if(gMC==0) {// No Monti Carlo to init. Default set fITSgeom by hand - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); nlad[0]=1;nlad[1]=1;nlad[2]=1;nlad[3]=1;nlad[4]=1; ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1; - fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + SetITSgeom(geom); r[0] = 1.0; r[1] = 0.0; r[2] = 0.0; r[3] = 0.0; r[4] = 0.0; r[5] = 1.0; r[6] = 0.0; r[7] = -1.0; r[8] = 0.0; r[9] = 1.0; // not Unit. @@ -600,9 +593,9 @@ void AliITSvSPD02::InitAliITSgeom(){ lad = 1; det = mod+1; t[0] = tt[mod][0]; t[1] = tt[mod][1]; t[2] = tt[mod][2]; - fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r); npar=3;par[0]=0.64;par[1]=0.5*300.0E-4;par[2]=3.48; - fITSgeom->ReSetShape(kSPD,new AliITSgeomSPD425Short(npar,par)); + GetITSgeom()->ReSetShape(kSPD,new AliITSgeomSPD425Short(npar,par)); } // end for det return; } // end if gMC==0 @@ -633,10 +626,11 @@ void AliITSvSPD02::InitAliITSgeom(){ strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4); // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]); mod = 5; - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); nlad[0]=1;nlad[1]=1;nlad[2]=1;nlad[3]=1;nlad[4]=1; ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1; - fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + SetITSgeom(geom); for(typ=1;typ<=kltypess;typ++){ for(j=0;jGetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,par,att, imat,imed); - fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r); - if(!(fITSgeom->IsShapeDefined((Int_t)kSPD))) - fITSgeom->ReSetShape(kSPD, + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r); + if(!(GetITSgeom()->IsShapeDefined((Int_t)kSPD))) + GetITSgeom()->ReSetShape(kSPD, new AliITSgeomSPD425Short(npar,par)); } // end for cpy } // end for typ @@ -678,11 +672,12 @@ void AliITSvSPD02::Init(){ if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); - if(fITSgeom!=0) delete fITSgeom; - fITSgeom = new AliITSgeom(); - if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); + if(GetITSgeom()!=0) SetITSgeom(0x0); + AliITSgeom* geom = new AliITSgeom(); + SetITSgeom(geom); + if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); if(!fGeomDetIn) this->InitAliITSgeom(); - if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); + if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); AliITS::Init(); for(i=0;i<72;i++) cout << "*"; @@ -703,20 +698,27 @@ void AliITSvSPD02::SetDefaults(){ Info("SetDefaults","Setting up only SPD detector"); - AliITSDetType *iDetType; + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + fDetTypeSim->SetITSgeom(GetITSgeom()); AliITSgeomSPD *s0; Int_t i; Float_t bx[256],bz[280]; - + fDetTypeSim->ResetResponse(); + fDetTypeSim->ResetSegmentation(); + //SPD - iDetType=DetType(kSPD); // Get shape info. Do it this way for now. - s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD); - AliITSresponse *resp0=new AliITSresponseSPD(); - resp0->SetTemperature(); - resp0->SetDistanceOverVoltage(); - SetResponseModel(kSPD,resp0); - AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom); + s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD); + AliITSresponse *resp0=0; + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSPD){ + resp0 = new AliITSresponseSPD(); + resp0->SetTemperature(); + resp0->SetDistanceOverVoltage(); + SetResponseModel(nmod,resp0); + } + } + AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom()); seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD s0->GetDz()*2.*kconv, // for now. s0->GetDy()*2.*kconv); // x,z,y full width in microns. @@ -732,16 +734,12 @@ void AliITSvSPD02::SetDefaults(){ seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. SetSegmentationModel(kSPD,seg0); // 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"); + const char *kData0=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD()))->DataType(); + if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); // SetSimulationModel(kSPD,new AliITSsimulationSPDdubna(seg0,resp0)); // iDetType->ReconstructionModel(new AliITSClusterFinderSPD()); - delete DetType(kSDD); - fDetTypes->AddAt(0,kSDD); - delete DetType(kSSD); - fDetTypes->AddAt(0,kSSD); + /* SetResponseModel(kSDD,new AliITSresponseSDD()); SetSegmentationModel(kSDD,new AliITSsegmentationSDD()); @@ -751,7 +749,7 @@ void AliITSvSPD02::SetDefaults(){ SetSegmentationModel(kSSD,new AliITSsegmentationSSD()); DetType(kSSD)->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD"); */ - if(kNTYPES>3){ + if(fgkNTYPES>3){ Warning("SetDefaults", "Only the four basic detector types are initialised!"); }// end if @@ -767,58 +765,57 @@ void AliITSvSPD02::SetDefaultSimulation(){ // Return: // none. - AliITSDetType *iDetType; - AliITSsimulation *sim; - AliITSsegmentation *seg; - AliITSresponse *res; - iDetType=DetType(kSPD); - if(iDetType){ - sim = iDetType->GetSimulationModel(); + if(GetITSgeom()==0){ + Warning("SetDefaultSimulation","ITS geometry is null!"); + return; + } + + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + AliITSsimulation *sim; + AliITSsegmentation *seg; + AliITSresponse *res; + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSPD); if (!sim) { - seg = (AliITSsegmentation*)iDetType->GetSegmentationModel(); - res = (AliITSresponse*)iDetType->GetResponseModel(); + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD()); sim = new AliITSsimulationSPDdubna(seg,res,0); 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(); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSPD)); + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD)); + sim->Init(); } // end if } // end if iDetType - iDetType=DetType(kSDD); - if(iDetType){ - sim = iDetType->GetSimulationModel(); + + /* + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSDD); if (!sim) { - seg = (AliITSsegmentation*)iDetType->GetSegmentationModel(); - res = (AliITSresponse*)iDetType->GetResponseModel(); + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD()); 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(); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD())); + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD)); + sim->Init(); } //end if } // end if iDetType - iDetType=DetType(kSSD); - if(iDetType){ - sim = iDetType->GetSimulationModel(); + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSSD); if (!sim) { - seg = (AliITSsegmentation*)iDetType->GetSegmentationModel(); - res = (AliITSresponse*)iDetType->GetResponseModel(); + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD()); 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(); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD())); + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD)); + sim->Init(); } // end if - } // end if iDetType + } // + */ } //______________________________________________________________________ void AliITSvSPD02::DrawModule() const { diff --git a/ITS/AliITSvSPD02.h b/ITS/AliITSvSPD02.h index 655e2961330..7160a15cb40 100644 --- a/ITS/AliITSvSPD02.h +++ b/ITS/AliITSvSPD02.h @@ -7,6 +7,14 @@ */ // ITS step manager and geometry class for the ITS SPD test beam geometry // of Summer 2002. +/////////////////////////////////////////////////////////////////////// +// Step manager and +// geometry class +// for the ITS +// SPD test beam +// geometry of summer 2002 +// +/////////////////////////////////////////////////////////////////////// #include "AliITS.h" diff --git a/ITS/AliITSvSSD03.cxx b/ITS/AliITSvSSD03.cxx index 729708edbc3..aea257c23f4 100644 --- a/ITS/AliITSvSSD03.cxx +++ b/ITS/AliITSvSSD03.cxx @@ -16,8 +16,6 @@ // Enrico Fragiacomo - 15/03/2004 // Geometry for the June 2003 SSD beam test -#include -#include #include #include #include @@ -33,18 +31,13 @@ #include "AliITSvSSD03.h" #include "AliITSgeom.h" #include "AliITSgeomSSD.h" -#include "AliITSDetType.h" -#include "AliITSresponseSPD.h" -#include "AliITSresponseSDD.h" +#include "AliITSDetTypeSim.h" #include "AliITSresponseSSD.h" -#include "AliITSsegmentationSPD.h" -#include "AliITSsegmentationSDD.h" #include "AliITSsegmentationSSD.h" -#include "AliITSsimulationSPDdubna.h" -#include "AliITSsimulationSDD.h" #include "AliITSsimulationSSD.h" #include "AliMC.h" + /////////////////////////////////////////////////////////////////////// // Step manager and // geometry class @@ -513,14 +506,15 @@ void AliITSvSSD03::InitAliITSgeom(){ Int_t mod=0,typ=0,lay=0,lad=0,det=0,cpy=0,i=0,j=0,k=0; if(gMC==0) {// No MonteCarlo to init. Default set fITSgeom by hand - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); //nlad[0]=1;nlad[1]=1;nlad[2]=1;nlad[3]=1;nlad[4]=1; //ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1; nlad[0]=1; ndet[0]=1; - fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + SetITSgeom(geom); r[0] = 1.0; r[1] = 0.0; r[2] = 0.0; r[3] = 0.0; r[4] = 0.0; r[5] = 1.0; @@ -534,11 +528,11 @@ void AliITSvSSD03::InitAliITSgeom(){ lad = 1; det = mod+1; t[0] = tt[mod][0]; t[1] = tt[mod][1]; t[2] = tt[mod][2]; - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); npar=3;par[0]=3.5;par[1]=0.5*300.0E-4;par[2]=2.0; - fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD275and75(npar,par)); + GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD275and75(npar,par)); } // end for det return; } // end if gMC==0 @@ -567,11 +561,12 @@ void AliITSvSSD03::InitAliITSgeom(){ strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4); // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]); mod = 1; // was 5 - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); nlad[0]=1; ndet[0]=1; - fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,mod); + SetITSgeom(geom); for(typ=1;typ<=kltypess;typ++){ for(j=0;jGetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,par,att, imat,imed); - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); //cout<IsShapeDefined((Int_t)kSSD))) - fITSgeom->ReSetShape(kSSD, new AliITSgeomSSD275and75(npar,par)); + if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD))) + GetITSgeom()->ReSetShape(kSSD, new AliITSgeomSSD275and75(npar,par)); } // end for cpy } // end for typ return; @@ -614,11 +609,12 @@ void AliITSvSSD03::Init(){ // if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); - if(fITSgeom!=0) delete fITSgeom; - fITSgeom = new AliITSgeom(); - if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); + if(GetITSgeom()!=0) SetITSgeom(0x0); + AliITSgeom* geom = new AliITSgeom(); + SetITSgeom(geom); + if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); if(!fGeomDetIn) this->InitAliITSgeom(); - if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); + if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); AliITS::Init(); // for(i=0;i<72;i++) cout << "*"; @@ -639,18 +635,29 @@ void AliITSvSSD03::SetDefaults(){ Info("SetDefaults","Setting up only SSD detector"); - AliITSDetType *iDetType; + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + fDetTypeSim->SetITSgeom(GetITSgeom()); AliITSgeomSSD *s0; - + fDetTypeSim->ResetResponse(); + fDetTypeSim->ResetSegmentation(); + //SSD - iDetType=DetType(kSSD); // Get shape info. Do it this way for now. - s0 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD); - AliITSresponse *resp0=new AliITSresponseSSD("simulated"); + s0 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD); + AliITSresponse *resp0=0; + Int_t nssd=0; + + for(Int_t nmod=0;nmodGetIndexMax();nmod++){ + if(GetITSgeom()->GetModuleType(nmod)==kSSD){ + resp0= new AliITSresponseSSD("simulated"); + SetResponseModel(nmod,resp0); + nssd=nmod; + } + } - SetResponseModel(kSSD,resp0); - AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD(fITSgeom); + + AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD(GetITSgeom()); seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD s0->GetDz()*2.*kconv, // for now. s0->GetDy()*2.*kconv); // x,z,y full width in microns. @@ -659,25 +666,24 @@ void AliITSvSSD03::SetDefaults(){ SetSegmentationModel(kSSD,seg0); // set digit and raw cluster classes to be used - const char *kData0=(iDetType->GetResponseModel())->DataType(); - if (strstr(kData0,"real")) iDetType->ClassNames("AliITSdigit", - "AliITSRawClusterSSD"); - else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD"); + const char *kData0=(fDetTypeSim->GetResponseModel(nssd))->DataType(); + if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit"); + else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD"); // SetSimulationModel(kSSD,new AliITSsimulationSSD(seg0,resp0)); // iDetType->ReconstructionModel(new AliITSClusterFinderSSD()); - +/* SetResponseModel(kSPD,new AliITSresponseSPD()); SetSegmentationModel(kSPD,new AliITSsegmentationSPD()); - DetType(kSPD)->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD"); + fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); SetResponseModel(kSDD,new AliITSresponseSDD()); SetSegmentationModel(kSDD,new AliITSsegmentationSDD()); - DetType(kSDD)->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD"); - + fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD"); +*/ - if(kNTYPES>3){ + if(fgkNTYPES>3){ Warning("SetDefaults", "Only the four basic detector types are initialised!"); }// end if @@ -693,61 +699,77 @@ void AliITSvSSD03::SetDefaultSimulation(){ // 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 AliITSsimulationSPDdubna(seg,res,1); - SetSimulationModel(kSPD,sim); - }else{ // simulation exists, make sure it is set up properly. - ((AliITSsimulation*)sim)->Init(); -// if(sim->GetResponseModel()==0) sim->SetResponseModel( -// (AliITSresponse*)iDetType->GetResponseModel()); -// if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel( -// (AliITSsegmentation*)iDetType->GetSegmentationModel()); - } // 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. - ((AliITSsimulation*)sim)->Init(); -// if(sim->GetResponseModel()==0) sim->SetResponseModel( -// (AliITSresponse*)iDetType->GetResponseModel()); -// if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel( -// (AliITSsegmentation*)iDetType->GetSegmentationModel()); + if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); + + AliITSsimulation *sim; + AliITSsegmentation *seg; + AliITSresponse *res; + Int_t nspd=0; + Int_t nsdd=0; + Int_t nssd=0; + for(Int_t i=0;iGetIndexMax();i++){ + if(GetITSgeom()->GetModuleType(i)==kSPD) nspd=i; + if(GetITSgeom()->GetModuleType(i)==kSDD) nsdd=i; + if(GetITSgeom()->GetModuleType(i)==kSSD) nssd=i; + } + /* + //SPD + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSPD); + if (!sim) { + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nspd); + sim = new AliITSsimulationSPDdubna(seg,res,1); + SetSimulationModel(kSPD,sim); + }else{ // simulation exists, make sure it is set up properly. + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD)); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nspd)); + ((AliITSsimulation*)sim)->Init(); + // if(sim->GetResponseModel()==0) sim->SetResponseModel( + // (AliITSresponse*)iDetType->GetResponseModel()); + // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel( + // (AliITSsegmentation*)iDetType->GetSegmentationModel()); + } // end if + } // end if !fDetTypeSim + + //SDD + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSDD); + if (!sim) { + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd); + sim = new AliITSsimulationSDD(seg,res); + SetSimulationModel(kSDD,sim); + }else{ // simulation exists, make sure it is set up properly. + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD)); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd)); + + ((AliITSsimulation*)sim)->Init(); + // if(sim->GetResponseModel()==0) sim->SetResponseModel( + // (AliITSresponse*)iDetType->GetResponseModel()); + // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel( + // (AliITSsegmentation*)iDetType->GetSegmentationModel()); } //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. - ((AliITSsimulation*)sim)->Init(); -// if(sim->GetResponseModel()==0) sim->SetResponseModel( -// (AliITSresponse*)iDetType->GetResponseModel()); -// if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel( -// (AliITSsegmentation*)iDetType->GetSegmentationModel()); - } // end if - } // end if !iDetType + } // end if !iDetType + */ + //SSD + if(fDetTypeSim){ + sim = fDetTypeSim->GetSimulationModel(kSSD); + if (!sim) { + seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD); + res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nssd); + sim = new AliITSsimulationSSD(seg,res); + SetSimulationModel(kSSD,sim); + }else{ // simulation exists, make sure it is set up properly. + sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD)); + sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nssd)); + ((AliITSsimulation*)sim)->Init(); + // if(sim->GetResponseModel()==0) sim->SetResponseModel( + // (AliITSresponse*)iDetType->GetResponseModel()); + // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel( + // (AliITSsegmentation*)iDetType->GetSegmentationModel()); + } // end if + } // end if !iDetType } //______________________________________________________________________ diff --git a/ITS/AliITSvSSD03.h b/ITS/AliITSvSSD03.h index 04d1b0cf9d2..18c680a9621 100644 --- a/ITS/AliITSvSSD03.h +++ b/ITS/AliITSvSSD03.h @@ -3,9 +3,10 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -// ITS step manager and geometry class for the ITS SSD test beam geometry -// of june 2003. - +//////////////////////////////////////////////////////////////////////////// +// ITS step manager and geometry class for the ITS SSD test beam geometry // +// of june 2003. // +//////////////////////////////////////////////////////////////////////////// #include "AliITS.h" class AliITSvSSD03 : public AliITS{ diff --git a/ITS/AliITSvtest.cxx b/ITS/AliITSvtest.cxx index 67ff26a7c0d..cb8ca2940ec 100644 --- a/ITS/AliITSvtest.cxx +++ b/ITS/AliITSvtest.cxx @@ -227,10 +227,10 @@ void AliITSvtest::InitAliITSgeom(){ mod += k; } // end for i - if(fITSgeom!=0) delete fITSgeom; + if(GetITSgeom()!=0) SetITSgeom(0x0); nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38; ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25; - fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod); + SetITSgeom(new AliITSgeom(0,6,nlad,ndet,mod)); mod = -1; for(lay=1;lay<=kNlayers;lay++){ for(j=0;jGetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt, par,att,imat,imed); - fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r); - if(!(fITSgeom->IsShapeDefined((Int_t)kSPD))) + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r); + if(!(GetITSgeom()->IsShapeDefined((Int_t)kSPD))) if(fMinorVersion==1){ - fITSgeom->ReSetShape(kSPD, + GetITSgeom()->ReSetShape(kSPD, new AliITSgeomSPD425Short()); } else if(fMinorVersion==2) - fITSgeom->ReSetShape(kSPD, + GetITSgeom()->ReSetShape(kSPD, new AliITSgeomSPD425Short()); } // end for det } // end for k @@ -271,19 +271,19 @@ void AliITSvtest::InitAliITSgeom(){ par,att,imat,imed); switch (lay){ case 3: case 4: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r); - if(!(fITSgeom->IsShapeDefined(kSDD))) - fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD256()); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSDD,t,r); + if(!(GetITSgeom()->IsShapeDefined(kSDD))) + GetITSgeom()->ReSetShape(kSDD,new AliITSgeomSDD256()); break; case 5: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); - if(!(fITSgeom->IsShapeDefined(kSSD))) - fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD275and75()); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + if(!(GetITSgeom()->IsShapeDefined(kSSD))) + GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD275and75()); break; case 6: - fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r); - if(!(fITSgeom->IsShapeDefined(kSSD))) - fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD75and275()); + GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r); + if(!(GetITSgeom()->IsShapeDefined(kSSD))) + GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD75and275()); break; } // end switch } // end for det @@ -306,11 +306,11 @@ void AliITSvtest::Init(){ // if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); - if(fITSgeom!=0) delete fITSgeom; - fITSgeom = new AliITSgeom(); - if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); + if(GetITSgeom()!=0) SetITSgeom(0x0); + SetITSgeom(new AliITSgeom()); + if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); if(!fGeomDetIn) this->InitAliITSgeom(); - if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); + if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); AliITS::Init(); // for(i=0;i<72;i++) cout << "*"; diff --git a/ITS/ITSLinkDef.h b/ITS/ITSLinkDef.h deleted file mode 100644 index d59ed92dc69..00000000000 --- a/ITS/ITSLinkDef.h +++ /dev/null @@ -1,218 +0,0 @@ -#ifdef __CINT__ -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -/* $Id$ */ - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; -//#pragma link C++ enum Cluster_t; - -//#pragma link C++ global gITSdisplay; // global used by AliITSdisplay - -// Standard ITS classes - -#pragma link C++ class AliITS+; -#pragma link C++ class AliITSvPPRcoarseasymm+; -#pragma link C++ class AliITSvPPRasymmFMD+; -#pragma link C++ class AliITSvSPD02+; -#pragma link C++ class AliITSvSDD03+; -#pragma link C++ class AliITSvSSD03+; -#pragma link C++ class AliITSvBeamTestITS04+; -//#pragma link C++ class AliITSv11+; -//#pragma link C++ class AliITSv11GeomCable+; -//#pragma link C++ class AliITSv11GeomCableFlat+; -//#pragma link C++ class AliITSv11GeomCableRound+; -//#pragma link C++ class AliITSv11Geometry+; -//#pragma link C++ class AliITSv11GeometrySupport+; -//#pragma link C++ class AliITSv11GeometrySPD+; -//#pragma link C++ class AliITSv11GeometrySDD+; -//#pragma link C++ class AliITSv11GeometrySSD+; -//#pragma link C++ class AliITSv11GeomCable+; -//#pragma link C++ class AliITSv11GeomcableFlat+; -//#pragma link C++ class AliITSv11GeomcableRound+; -// -#pragma link C++ class AliITSspdTestBeam+; -//#pragma link C++ class AliITSTestBeamData-; -//#pragma link C++ class AliITSspdTestBeamHeader-; -//#pragma link C++ class AliITSspdTestBeamTail-; -//#pragma link C++ class AliITSspdTestBeamBurst-; -//#pragma link C++ class AliITSspdTestBeamData-; -// -//#pragma link C++ class AliITSMixture+; -//#pragma link C++ class AliITSGeoCable+; -// -#pragma link C++ class AliITShit+; -#pragma link C++ class AliITSdigit+; -#pragma link C++ class AliITSdigitSPD+; -#pragma link C++ class AliITSdigitSDD+; -#pragma link C++ class AliITSdigitSSD+; -#pragma link C++ class AliITSTransientDigit+; -#pragma link C++ class AliITSgeom+; -#pragma link C++ class AliITSgeomMatrix-; -#pragma link C++ class AliITSgeomSPD+; -#pragma link C++ class AliITSgeomSDD+; -#pragma link C++ class AliITSgeomSSD+; -#pragma link C++ class AliITSGeant3Geometry+; -// Standard ITS detector class initilizers -#pragma link C++ class AliITSgeomSPD300+; -#pragma link C++ class AliITSgeomSPD425Short+; -#pragma link C++ class AliITSgeomSPD425Long+; -#pragma link C++ class AliITSgeomSDD256+; -#pragma link C++ class AliITSgeomSDD300+; -#pragma link C++ class AliITSgeomSSD175+; -#pragma link C++ class AliITSgeomSSD275and75+; -#pragma link C++ class AliITSgeomSSD75and275+; - -#pragma link C++ class AliITSmodule+; -#pragma link C++ class AliITSRecPoint+; -#pragma link C++ class AliITSRawCluster+; -#pragma link C++ class AliITSRawClusterSPD+; -#pragma link C++ class AliITSRawClusterSDD+; -#pragma link C++ class AliITSRawClusterSSD+; -#pragma link C++ class AliITSMap+; -#pragma link C++ class AliITSMapA1+; -#pragma link C++ class AliITSMapA2+; -#pragma link C++ class AliITSsegmentation+; -#pragma link C++ class AliITSsegmentationSPD+; -#pragma link C++ class AliITSsegmentationSDD+; -#pragma link C++ class AliITSsegmentationSSD+; -#pragma link C++ class AliITSresponse+; -#pragma link C++ class AliITSresponseSPD+; -//#pragma link C++ class AliITSresponseSPDdubna+; -#pragma link C++ class AliITSresponseSDD+; -#pragma link C++ class AliITSresponseSSD+; -#pragma link C++ class AliITSsimulation+; -#pragma link C++ class AliITSsimulationSPD+; -#pragma link C++ class AliITSsimulationSPDdubna+; -#pragma link C++ class AliITSsimulationSDD+; -#pragma link C++ class AliITSsimulationSSD+; -#pragma link C++ class AliITSTableSSD+; -#pragma link C++ class AliITSpList+; -#pragma link C++ class AliITSpListItem+; -#pragma link C++ class AliITSsimulationFastPoints+; -#pragma link C++ class AliITSsimulationFastPointsV0+; -#pragma link C++ class AliITSClusterFinder+; -#pragma link C++ class AliITSClusterFinderSPD+; -//#pragma link C++ class AliITSClusterFinderSPDdubna+; -#pragma link C++ class AliITSClusterFinderSDD+; -#pragma link C++ class AliITSClusterFinderSSD+; -#pragma link C++ class AliITSDetType+; -#pragma link C++ class AliITSstatistics+; -#pragma link C++ class AliITSstatistics2+; -// SDD simulation -#pragma link C++ class AliITSRawData+; -// These streamers must be formatted according to the raw data fromat -#pragma link C++ class AliITSInStream+; -#pragma link C++ class AliITSOutStream+; -// -#pragma link C++ class AliITSHNode+; -#pragma link C++ class AliITSHTable+; -#pragma link C++ class AliITSetfSDD+; -// SSD simulation and reconstruction -#pragma link C++ class AliITSdcsSSD+; -#pragma link C++ class AliITSclusterSSD+; -#pragma link C++ class AliITSpackageSSD+; -#pragma link C++ class AliITSPid+; -#pragma link C++ class AliITSpidESD+; -#pragma link C++ class AliITStrackV2Pid+; -// Classes used for Tracking -#pragma link C++ class AliITSTrackV1+; -#pragma link C++ class AliITSRad+; -#pragma link C++ class AliITSIOTrack+; -#pragma link C++ class AliITSTrackerV1+; -#pragma link C++ class AliITSRiemannFit+; -// New used for Alignment studdies -//#pragma link C++ class AliITSAlignmentTrack-; -//#pragma link C++ class AliITSAlignmentModule-; -//#pragma link C function HitsTo; -//#pragma link C function HitsToClustAl; -//#pragma link C function FillGlobalPositions; -//#pragma link C function PlotGeomChanges; -//#pragma link C function FitAllTracks; -//#pragma link C function FitVertexAll; -//#pragma link C function OnlyOneGeometry; -//#pragma link C function deleteClustAl; -// New used for AliITSdisplay -//#pragma link C++ class AliITSdisplay; -//#pragma link C++ class AliITSDisplay; -//#pragma link C++ class TInputDialog; // MUST BE RENAMED -//#pragma link C function OpenFileDialog; -//#pragma link C function GetStringDialog; -//#pragma link C function GetIntegerDialog; -//#pragma link C function GetFloatDialog; -// This class will always be for ITS only -#pragma link C++ class AliITSvtest+; - -#pragma link C++ class AliITSclustererV2+; -#pragma link C++ class AliITSclusterV2+; -#pragma link C++ class AliITStrackV2+; -#pragma link C++ class AliITStrackerV2+; -#pragma link C++ class AliITStrackMI+; -#pragma link C++ class AliITStrackerMI+; -//#pragma link C++ class AliITSRecV0Info+; -#pragma link C++ class AliV0vertex+; -#pragma link C++ class AliV0vertexer+; -#pragma link C++ class AliCascadeVertex+; -#pragma link C++ class AliCascadeVertexer+; - -#pragma link C++ class AliITSVertexer+; -#pragma link C++ class AliITSVertexerIons+; -#pragma link C++ class AliITSVertexerPPZ+; -#pragma link C++ class AliITSVertexerZ+; -#pragma link C++ class AliITSStrLine+; -#pragma link C++ class AliITSVertexerTracks+; - -// Classes for neural tracking -#pragma link C++ class AliITSNeuralPoint+; -#pragma link C++ class AliITSNeuralTrack+; -#pragma link C++ class AliITSNeuralTracker+; -#pragma link C++ class AliITStrackerANN+; -// Tasks -#pragma link C++ class AliITSreconstruction+; -#pragma link C++ class AliITSsDigitize+; -#pragma link C++ class AliITSDigitizer+; -#pragma link C++ class AliITSFDigitizer+; -#pragma link C++ class AliITSFindClustersV2+; -//#pragma link C++ class DisplayITSv11+; -// Raw data -#pragma link C++ class AliITSDDLRawData+; - -#pragma link C++ class AliITSLoader+; - -#pragma link C++ class AliITSclusterTable+; -#pragma link C++ class AliITStrackerSA+; -#pragma link C++ class AliITStrackSA+; -#pragma link C++ class AliITSVertexerFast+; -#pragma link C++ class AliITSRawStream+; -#pragma link C++ class AliITSRawStreamSDD+; -#pragma link C++ class AliITSRawStreamSDDv2+; -#pragma link C++ class AliITSRawStreamSDDv3+; -#pragma link C++ class AliITSRawStreamSPD+; -#pragma link C++ class AliITSRawStreamSSD+; -#pragma link C++ class AliITSRawStreamSSDv1+; -#pragma link C++ class AliITSBeamTestDig+; -#pragma link C++ class AliITSBeamTestDigSPD+; -#pragma link C++ class AliITSBeamTestDigSDD+; -#pragma link C++ class AliITSBeamTestDigSSD+; -#pragma link C++ class AliITSBeamTestDigitizer+; -#pragma link C++ class AliITSEventHeader+; - -#pragma link C++ class AliITSReconstructor+; -#pragma link C++ class AliITSClusterFinderV2+; -#pragma link C++ class AliITSClusterFinderV2SDD+; -#pragma link C++ class AliITSClusterFinderV2SPD+; -#pragma link C++ class AliITSClusterFinderV2SSD+; - - -// -//#pragma link C++ class AliACORDEFunction+; -//#pragma link C++ class AliACORDEMaterial+; -//#pragma link C++ class AliACORDEMuonEloss+; -//#pragma link C++ class BetheBloch+; -//#pragma link C++ class Bremstrahlung+; -//#pragma link C++ class DirectElectronPairProduction+; -//#pragma link C++ class NuclearInteractions+; -// -#endif diff --git a/ITS/ITSbaseLinkDef.h b/ITS/ITSbaseLinkDef.h new file mode 100644 index 00000000000..2ad9780e9f6 --- /dev/null +++ b/ITS/ITSbaseLinkDef.h @@ -0,0 +1,73 @@ +#ifdef __CINT__ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +//#pragma link C++ enum Cluster_t; + +//#pragma link C++ global gITSdisplay; // global used by AliITSdisplay + +// Standard ITS classes + +#pragma link C++ class AliITSRecPoint+; +#pragma link C++ class AliITSclusterV2+; +#pragma link C++ class AliITSdigit+; +#pragma link C++ class AliITSdigitSPD+; +#pragma link C++ class AliITSdigitSDD+; +#pragma link C++ class AliITSdigitSSD+; +#pragma link C++ class AliITSTransientDigit+; +#pragma link C++ class AliITSgeom+; +#pragma link C++ class AliITSgeomMatrix-; +#pragma link C++ class AliITSgeomSPD+; +#pragma link C++ class AliITSgeomSDD+; +#pragma link C++ class AliITSgeomSSD+; +// Standard ITS detector class initilizers +#pragma link C++ class AliITSgeomSPD300+; +#pragma link C++ class AliITSgeomSPD425Short+; +#pragma link C++ class AliITSgeomSPD425Long+; +#pragma link C++ class AliITSgeomSDD256+; +#pragma link C++ class AliITSgeomSDD300+; +#pragma link C++ class AliITSgeomSSD175+; +#pragma link C++ class AliITSgeomSSD275and75+; +#pragma link C++ class AliITSgeomSSD75and275+; + + +#pragma link C++ class AliITSMap+; +#pragma link C++ class AliITSMapA1+; +#pragma link C++ class AliITSMapA2+; +#pragma link C++ class AliITSsegmentation+; +#pragma link C++ class AliITSsegmentationSPD+; +#pragma link C++ class AliITSsegmentationSDD+; +#pragma link C++ class AliITSsegmentationSSD+; +#pragma link C++ class AliITSresponse+; +#pragma link C++ class AliITSresponseSPD+; +#pragma link C++ class AliITSresponseSDD+; +#pragma link C++ class AliITSresponseSSD+; +#pragma link C++ class AliITSpList+; +#pragma link C++ class AliITSpListItem+; + +#pragma link C++ class AliITSRawData+; +// These streamers must be formatted according to the raw data fromat +#pragma link C++ class AliITSInStream+; +#pragma link C++ class AliITSOutStream+; +// +// Raw data +#pragma link C++ class AliITSDDLRawData+; + +#pragma link C++ class AliITSLoader+; + +#pragma link C++ class AliITSRawStream+; +#pragma link C++ class AliITSRawStreamSDD+; +#pragma link C++ class AliITSRawStreamSDDv2+; +#pragma link C++ class AliITSRawStreamSDDv3+; +#pragma link C++ class AliITSRawStreamSPD+; +#pragma link C++ class AliITSRawStreamSSD+; +#pragma link C++ class AliITSRawStreamSSDv1+; +#pragma link C++ class AliITSEventHeader+; + + +#endif diff --git a/ITS/ITSrecLinkDef.h b/ITS/ITSrecLinkDef.h new file mode 100644 index 00000000000..fa63785fe0a --- /dev/null +++ b/ITS/ITSrecLinkDef.h @@ -0,0 +1,85 @@ +#ifdef __CINT__ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +//#pragma link C++ enum Cluster_t; + +//#pragma link C++ global gITSdisplay; // global used by AliITSdisplay + +// Standard ITS classes + +#pragma link C++ class AliITSRawCluster+; +#pragma link C++ class AliITSRawClusterSPD+; +#pragma link C++ class AliITSRawClusterSDD+; +#pragma link C++ class AliITSRawClusterSSD+; +#pragma link C++ class AliITSClusterFinder+; +#pragma link C++ class AliITSClusterFinderSPD+; +//#pragma link C++ class AliITSClusterFinderSPDdubna+; +#pragma link C++ class AliITSClusterFinderSDD+; +#pragma link C++ class AliITSClusterFinderSSD+; +#pragma link C++ class AliITSDetTypeRec+; + +#pragma link C++ class AliITSclusterSSD+; +#pragma link C++ class AliITSpackageSSD+; +#pragma link C++ class AliITSPid+; +#pragma link C++ class AliITSpidESD+; +#pragma link C++ class AliITStrackV2Pid+; +// Classes used for Tracking +//#pragma link C++ class AliITSTrackV1+; +#pragma link C++ class AliITSRad+; +#pragma link C++ class AliITSIOTrack+; +//#pragma link C++ class AliITSTrackerV1+; +#pragma link C++ class AliITSRiemannFit+; + +#pragma link C++ class AliITSclustererV2+; +#pragma link C++ class AliITStrackV2+; +#pragma link C++ class AliITStrackerV2+; +#pragma link C++ class AliITStrackMI+; +#pragma link C++ class AliITStrackerMI+; +//#pragma link C++ class AliITSRecV0Info+; +#pragma link C++ class AliV0vertex+; +#pragma link C++ class AliV0vertexer+; +#pragma link C++ class AliCascadeVertex+; +#pragma link C++ class AliCascadeVertexer+; + +#pragma link C++ class AliITSVertexer+; +#pragma link C++ class AliITSVertexerIons+; +#pragma link C++ class AliITSVertexerPPZ+; +#pragma link C++ class AliITSVertexerZ+; +#pragma link C++ class AliITSStrLine+; +#pragma link C++ class AliITSVertexerTracks+; + +// Classes for neural tracking +#pragma link C++ class AliITSNeuralPoint+; +#pragma link C++ class AliITSNeuralTrack+; +#pragma link C++ class AliITSNeuralTracker+; +#pragma link C++ class AliITStrackerANN+; +// Tasks +#pragma link C++ class AliITSreconstruction+; +#pragma link C++ class AliITSFindClustersV2+; +//#pragma link C++ class DisplayITSv11+; + +#pragma link C++ class AliITSclusterTable+; +#pragma link C++ class AliITStrackerSA+; +#pragma link C++ class AliITStrackSA+; +#pragma link C++ class AliITSVertexerFast+; +#pragma link C++ class AliITSReconstructor+; +#pragma link C++ class AliITSClusterFinderV2+; +#pragma link C++ class AliITSClusterFinderV2SDD+; +#pragma link C++ class AliITSClusterFinderV2SPD+; +#pragma link C++ class AliITSClusterFinderV2SSD+; + +//beam test classes +#pragma link C++ class AliITSBeamTestDig+; +#pragma link C++ class AliITSBeamTestDigSPD+; +#pragma link C++ class AliITSBeamTestDigSDD+; +#pragma link C++ class AliITSBeamTestDigSSD+; +#pragma link C++ class AliITSBeamTestDigitizer+; + + +#endif diff --git a/ITS/ITSsimLinkDef.h b/ITS/ITSsimLinkDef.h new file mode 100644 index 00000000000..a1d7ec21399 --- /dev/null +++ b/ITS/ITSsimLinkDef.h @@ -0,0 +1,75 @@ +#ifdef __CINT__ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +//#pragma link C++ enum Cluster_t; + +//#pragma link C++ global gITSdisplay; // global used by AliITSdisplay + +// Standard ITS classes + +#pragma link C++ class AliITS+; +#pragma link C++ class AliITSvPPRcoarseasymm+; +#pragma link C++ class AliITSvPPRasymmFMD+; +#pragma link C++ class AliITSvSPD02+; +#pragma link C++ class AliITSvSDD03+; +#pragma link C++ class AliITSvSSD03+; +#pragma link C++ class AliITSvBeamTestITS04+; +//#pragma link C++ class AliITSv11+; +//#pragma link C++ class AliITSv11GeomCable+; +//#pragma link C++ class AliITSv11GeomCableFlat+; +//#pragma link C++ class AliITSv11GeomCableRound+; +//#pragma link C++ class AliITSv11Geometry+; +//#pragma link C++ class AliITSv11GeometrySupport+; +//#pragma link C++ class AliITSv11GeometrySPD+; +//#pragma link C++ class AliITSv11GeometrySDD+; +//#pragma link C++ class AliITSv11GeometrySSD+; +//#pragma link C++ class AliITSv11GeomCable+; +//#pragma link C++ class AliITSv11GeomcableFlat+; +//#pragma link C++ class AliITSv11GeomcableRound+; +// +#pragma link C++ class AliITSspdTestBeam+; +//#pragma link C++ class AliITSTestBeamData-; +//#pragma link C++ class AliITSspdTestBeamHeader-; +//#pragma link C++ class AliITSspdTestBeamTail-; +//#pragma link C++ class AliITSspdTestBeamBurst-; +//#pragma link C++ class AliITSspdTestBeamData-; +// +//#pragma link C++ class AliITSMixture+; +//#pragma link C++ class AliITSGeoCable+; +// +#pragma link C++ class AliITShit+; +#pragma link C++ class AliITSGeant3Geometry+; +// Standard ITS detector class initilizers +#pragma link C++ class AliITSmodule+; +#pragma link C++ class AliITSsimulation+; +#pragma link C++ class AliITSsimulationSPD+; +#pragma link C++ class AliITSsimulationSPDdubna+; +#pragma link C++ class AliITSsimulationSDD+; +#pragma link C++ class AliITSsimulationSSD+; +#pragma link C++ class AliITSTableSSD+; +#pragma link C++ class AliITSsimulationFastPoints+; +#pragma link C++ class AliITSsimulationFastPointsV0+; +#pragma link C++ class AliITSDetTypeSim+; +#pragma link C++ class AliITSstatistics+; +#pragma link C++ class AliITSstatistics2+; +// These streamers must be formatted according to the raw data fromat + +#pragma link C++ class AliITSHNode+; +#pragma link C++ class AliITSHTable+; +#pragma link C++ class AliITSetfSDD+; +// SSD simulation and reconstruction +#pragma link C++ class AliITSdcsSSD+; +#pragma link C++ class AliITSvtest+; +#pragma link C++ class AliITSsDigitize+; +#pragma link C++ class AliITSDigitizer+; +#pragma link C++ class AliITSFDigitizer+; +//#pragma link C++ class DisplayITSv11+; +// Raw data + +#endif diff --git a/ITS/libITS.pkg b/ITS/libITS.pkg deleted file mode 100644 index 9581cba841b..00000000000 --- a/ITS/libITS.pkg +++ /dev/null @@ -1,143 +0,0 @@ -SRCS = AliITS.cxx \ - AliITSvSPD02.cxx \ - AliITSvSDD03.cxx AliITSvSSD03.cxx \ - AliITSvPPRcoarseasymm.cxx \ - AliITSvPPRasymmFMD.cxx \ - AliITSvBeamTestITS04.cxx \ - AliITShit.cxx \ - AliITSDetType.cxx \ - AliITSgeom.cxx \ - AliITSgeomMatrix.cxx \ - AliITSgeomSPD.cxx \ - AliITSgeomSDD.cxx \ - AliITSgeomSSD.cxx \ - AliITSmodule.cxx \ - AliITSGeant3Geometry.cxx \ - AliITSLoader.cxx \ - AliITSsimulationFastPoints.cxx \ - AliITSsimulationFastPointsV0.cxx \ - AliITSsimulation.cxx \ - AliITSsimulationSPD.cxx \ - AliITSsimulationSPDdubna.cxx \ - AliITSsimulationSDD.cxx \ - AliITSsimulationSSD.cxx \ - AliITSTableSSD.cxx \ - AliITSetfSDD.cxx \ - AliITSdcsSSD.cxx \ - AliITSRawCluster.cxx \ - AliITSRecPoint.cxx \ - AliITSdigit.cxx \ - AliITSdigitSPD.cxx \ - AliITSdigitSDD.cxx \ - AliITSTransientDigit.cxx \ - AliITSdigitSSD.cxx \ - AliITSMap.cxx \ - AliITSMapA1.cxx \ - AliITSMapA2.cxx \ - AliITSpList.cxx \ - AliITSpListItem.cxx \ - AliITSsegmentation.cxx \ - AliITSsegmentationSPD.cxx \ - AliITSsegmentationSDD.cxx \ - AliITSsegmentationSSD.cxx \ - AliITSresponse.cxx \ - AliITSresponseSPD.cxx \ - AliITSresponseSDD.cxx \ - AliITSresponseSSD.cxx \ - AliITSClusterFinder.cxx \ - AliITSClusterFinderSPD.cxx \ - AliITSClusterFinderSDD.cxx \ - AliITSClusterFinderSSD.cxx \ - AliITSRawData.cxx \ - AliITSHuffman.cxx \ - AliITSclusterSSD.cxx \ - AliITSpackageSSD.cxx \ - AliITSstatistics.cxx \ - AliITSstatistics2.cxx \ - AliITSTrackV1.cxx \ - AliITSIOTrack.cxx \ - AliITSRad.cxx \ - AliITSTrackerV1.cxx \ - AliITSvtest.cxx \ - AliITSStrLine.cxx \ - AliITSclustererV2.cxx \ - AliITSclusterV2.cxx \ - AliITStrackV2.cxx \ - AliITStrackerV2.cxx \ - AliITStrackMI.cxx \ - AliITStrackerMI.cxx \ - AliITSVertexer.cxx \ - AliITSVertexerIons.cxx \ - AliITSVertexerPPZ.cxx \ - AliITSVertexerTracks.cxx \ - AliITSVertexerZ.cxx \ - AliV0vertex.cxx \ - AliV0vertexer.cxx \ - AliITSPid.cxx \ - AliITStrackV2Pid.cxx \ - AliCascadeVertex.cxx \ - AliCascadeVertexer.cxx \ - AliITSsDigitize.cxx \ - AliITSDigitizer.cxx \ - AliITSreconstruction.cxx \ - AliITSFindClustersV2.cxx \ - AliITSRiemannFit.cxx \ - AliITSFDigitizer.cxx \ - AliITSclusterTable.cxx \ - AliITStrackSA.cxx \ - AliITStrackerSA.cxx \ - AliITSNeuralPoint.cxx \ - AliITSNeuralTrack.cxx \ - AliITSNeuralTracker.cxx \ - AliITStrackerANN.cxx \ - AliITSVertexerFast.cxx \ - AliITSDDLRawData.cxx \ - AliITSpidESD.cxx \ - AliITSRawClusterSPD.cxx \ - AliITSRawClusterSDD.cxx \ - AliITSRawClusterSSD.cxx\ - AliITSspdTestBeam.cxx \ - AliITSReconstructor.cxx \ - AliITSRawStream.cxx \ - AliITSRawStreamSDDv2.cxx \ - AliITSRawStreamSDDv3.cxx \ - AliITSRawStreamSSD.cxx \ - AliITSRawStreamSDD.cxx \ - AliITSRawStreamSPD.cxx \ - AliITSBeamTestDig.cxx \ - AliITSBeamTestDigSDD.cxx \ - AliITSBeamTestDigSPD.cxx \ - AliITSBeamTestDigSSD.cxx \ - AliITSBeamTestDigitizer.cxx \ - AliITSEventHeader.cxx \ - AliITSRawStreamSSDv1.cxx \ - AliITSClusterFinderV2.cxx \ - AliITSClusterFinderV2SDD.cxx \ - AliITSClusterFinderV2SPD.cxx \ - AliITSClusterFinderV2SSD.cxx \ - -# AliITSv11.cxx \ -# AliITSv11Geometry.cxx \ -# AliITSv11GeometrySupport.cxx \ -# AliITSv11GeometrySPD.cxx \ -# AliITSv11GeometrySDD.cxx \ -# AliITSv11GeometrySSD.cxx \ -# AliITSv11GeomCable.cxx \ -# AliITSv11GeomCableFlat.cxx \ -# AliITSv11GeomCableRound.cxx \ - -# DisplayITSv11.cxx \ -# AliITSBaseGeometry.cxx \ -# AliITSAlignmentTrack.cxx AliITSAlignmentModule.cxx \ -# AliACORDEFunctions.cxx \ -# AliITSresponseSPDdubna.cxx \ -# AliITSClusterFinderSPDdubna.cxx \ - -HDRS:= $(SRCS:.cxx=.h) - -DHDR=ITSLinkDef.h - -EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC RAW - -EXPORT:=AliITStrackV2.h AliITSVertexerTracks.h AliV0vertexer.h \ - AliV0vertex.h AliITSVertexer.h AliITSrecoV2.h diff --git a/ITS/libITSbase.pkg b/ITS/libITSbase.pkg new file mode 100644 index 00000000000..b7a284b8702 --- /dev/null +++ b/ITS/libITSbase.pkg @@ -0,0 +1,43 @@ +SRCS = AliITSgeom.cxx \ + AliITSgeomMatrix.cxx \ + AliITSgeomSPD.cxx \ + AliITSgeomSDD.cxx \ + AliITSgeomSSD.cxx \ + AliITSLoader.cxx \ + AliITSRecPoint.cxx \ + AliITSclusterV2.cxx \ + AliITSdigit.cxx \ + AliITSdigitSPD.cxx \ + AliITSdigitSDD.cxx \ + AliITSTransientDigit.cxx \ + AliITSdigitSSD.cxx \ + AliITSMap.cxx \ + AliITSMapA1.cxx \ + AliITSMapA2.cxx \ + AliITSpList.cxx \ + AliITSpListItem.cxx \ + AliITSsegmentation.cxx \ + AliITSsegmentationSPD.cxx \ + AliITSsegmentationSDD.cxx \ + AliITSsegmentationSSD.cxx \ + AliITSresponse.cxx \ + AliITSresponseSPD.cxx \ + AliITSresponseSDD.cxx \ + AliITSresponseSSD.cxx \ + AliITSDDLRawData.cxx \ + AliITSRawStream.cxx \ + AliITSRawStreamSDDv2.cxx \ + AliITSRawStreamSDDv3.cxx \ + AliITSRawStreamSSD.cxx \ + AliITSRawStreamSDD.cxx \ + AliITSRawStreamSPD.cxx \ + AliITSEventHeader.cxx \ + AliITSRawStreamSSDv1.cxx \ + AliITSRawData.cxx + +HDRS:= $(SRCS:.cxx=.h) + +DHDR=ITSbaseLinkDef.h + +EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC RAW + diff --git a/ITS/libITSrec.pkg b/ITS/libITSrec.pkg new file mode 100644 index 00000000000..e39ed6d5a0b --- /dev/null +++ b/ITS/libITSrec.pkg @@ -0,0 +1,61 @@ +SRCS = AliITSDetTypeRec.cxx \ + AliITSRawCluster.cxx \ + AliITSClusterFinder.cxx \ + AliITSClusterFinderSPD.cxx \ + AliITSClusterFinderSDD.cxx \ + AliITSClusterFinderSSD.cxx \ + AliITSClusterFinderV2.cxx \ + AliITSClusterFinderV2SDD.cxx \ + AliITSClusterFinderV2SPD.cxx \ + AliITSClusterFinderV2SSD.cxx \ + AliITSclustererV2.cxx \ + AliITSclusterSSD.cxx \ + AliITSpackageSSD.cxx \ + AliITSIOTrack.cxx \ + AliITSRad.cxx \ + AliITSStrLine.cxx \ + AliITStrackV2.cxx \ + AliITStrackerV2.cxx \ + AliITStrackMI.cxx \ + AliITStrackerMI.cxx \ + AliITSVertexer.cxx \ + AliITSVertexerIons.cxx \ + AliITSVertexerPPZ.cxx \ + AliITSVertexerTracks.cxx \ + AliITSVertexerZ.cxx \ + AliITSVertexerFast.cxx \ + AliV0vertex.cxx \ + AliV0vertexer.cxx \ + AliITSPid.cxx \ + AliITStrackV2Pid.cxx \ + AliCascadeVertex.cxx \ + AliCascadeVertexer.cxx \ + AliITSreconstruction.cxx \ + AliITSFindClustersV2.cxx \ + AliITSRiemannFit.cxx \ + AliITSclusterTable.cxx \ + AliITStrackSA.cxx \ + AliITStrackerSA.cxx \ + AliITSNeuralPoint.cxx \ + AliITSNeuralTrack.cxx \ + AliITSNeuralTracker.cxx \ + AliITStrackerANN.cxx \ + AliITSpidESD.cxx \ + AliITSRawClusterSPD.cxx \ + AliITSRawClusterSDD.cxx \ + AliITSRawClusterSSD.cxx\ + AliITSReconstructor.cxx \ + AliITSBeamTestDig.cxx \ + AliITSBeamTestDigSDD.cxx \ + AliITSBeamTestDigSPD.cxx \ + AliITSBeamTestDigSSD.cxx \ + AliITSBeamTestDigitizer.cxx\ + +HDRS:= $(SRCS:.cxx=.h) + +DHDR=ITSrecLinkDef.h + +EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC RAW + +EXPORT:=AliITStrackV2.h AliITSVertexerTracks.h AliV0vertexer.h \ + AliV0vertex.h AliITSVertexer.h AliITSrecoV2.h diff --git a/ITS/libITSsim.pkg b/ITS/libITSsim.pkg new file mode 100644 index 00000000000..6216635482c --- /dev/null +++ b/ITS/libITSsim.pkg @@ -0,0 +1,38 @@ +SRCS = AliITS.cxx \ + AliITSvSPD02.cxx \ + AliITSvSDD03.cxx \ + AliITSvSSD03.cxx \ + AliITSvPPRcoarseasymm.cxx \ + AliITSvPPRasymmFMD.cxx \ + AliITSvBeamTestITS04.cxx \ + AliITShit.cxx \ + AliITSDetTypeSim.cxx \ + AliITSmodule.cxx \ + AliITSGeant3Geometry.cxx \ + AliITSsimulationFastPoints.cxx \ + AliITSsimulationFastPointsV0.cxx \ + AliITSsimulation.cxx \ + AliITSsimulationSPD.cxx \ + AliITSsimulationSPDdubna.cxx \ + AliITSsimulationSDD.cxx \ + AliITSsimulationSSD.cxx \ + AliITSTableSSD.cxx \ + AliITSetfSDD.cxx \ + AliITSdcsSSD.cxx \ + AliITSHuffman.cxx \ + AliITSstatistics.cxx \ + AliITSstatistics2.cxx \ + AliITSvtest.cxx \ + AliITSsDigitize.cxx \ + AliITSDigitizer.cxx \ + AliITSFDigitizer.cxx \ + AliITSspdTestBeam.cxx \ + + +HDRS:= $(SRCS:.cxx=.h) + +DHDR=ITSsimLinkDef.h + +EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC RAW + + diff --git a/MONITOR/AliMonitorProcess.cxx b/MONITOR/AliMonitorProcess.cxx index a0dbcaa71d6..b87504c8e06 100644 --- a/MONITOR/AliMonitorProcess.cxx +++ b/MONITOR/AliMonitorProcess.cxx @@ -35,8 +35,8 @@ #include "AliLog.h" #include "AliESD.h" -#include "AliITS.h" #include "AliITSclustererV2.h" +#include "AliITSgeom.h" #include "AliITStrackerV2.h" #include "AliLoader.h" #include "AliMonitorHLT.h" @@ -140,9 +140,7 @@ AliMonitorProcess::AliMonitorProcess( fRunLoader->LoadgAlice(); gAlice = fRunLoader->GetAliRun(); if (!gAlice) AliFatal("no gAlice object found"); - AliITS* its = (AliITS*) gAlice->GetModule("ITS"); - if (!its) AliFatal("no ITS detector found"); - fITSgeom = its->GetITSgeom(); + fITSgeom = (AliITSgeom*)gDirectory->Get("AliITSgeom"); if (!fITSgeom) AliFatal("could not load ITS geometry"); // Init TPC parameters for HLT diff --git a/MONITOR/binmonitorCheck.pkg b/MONITOR/binmonitorCheck.pkg index 515d75b4345..643fdb5d0ab 100644 --- a/MONITOR/binmonitorCheck.pkg +++ b/MONITOR/binmonitorCheck.pkg @@ -17,7 +17,7 @@ PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS) ifdef DATE_ROOT ELIBSDIR:=${DATE_MONITOR_DIR}/${DATE_SYS} -ELIBS:= ESD STEER RAWData monitor shift TPCbase TPCsim TPCrec ITS AliL3Src AliL3Comp AliL3Misc AliL3Hough AliL3ITS +ELIBS:= ESD STEER RAWData monitor shift TPCbase TPCsim TPCrec ITSbase ITSsim ITSraw AliL3Src AliL3Comp AliL3Misc AliL3Hough AliL3ITS EINCLUDE+= ${DATE_COMMON_DEFS} ${DATE_MONITOR_DIR} endif diff --git a/MONITOR/binmonitorGDC.pkg b/MONITOR/binmonitorGDC.pkg index 9cd3d78e796..e1bed3488f4 100644 --- a/MONITOR/binmonitorGDC.pkg +++ b/MONITOR/binmonitorGDC.pkg @@ -17,7 +17,7 @@ PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS) ifdef DATE_ROOT ELIBSDIR:=${DATE_MONITOR_DIR}/${DATE_SYS} -ELIBS:=ESD STEER RAWData TPCbase TPCsim TPCrec AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS monitor shift +ELIBS:=ESD STEER RAWData TPCbase TPCsim TPCrec AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITSbase ITSsim ITSrec monitor shift EINCLUDE+= ${DATE_COMMON_DEFS} ${DATE_MONITOR_DIR} endif diff --git a/RAW/binalimdc.pkg b/RAW/binalimdc.pkg index 577e6366eb1..e11844c1a92 100644 --- a/RAW/binalimdc.pkg +++ b/RAW/binalimdc.pkg @@ -14,7 +14,7 @@ EINCLUDE+= TP ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS) -ELIBS:=ESD RAWData MDC MDCFilter STEER TPCbase TPCsim TPCrec AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS +ELIBS:=ESD RAWData MDC MDCFilter STEER TPCbase TPCsim TPCrec AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITSbase ITSsim ITSrec ifneq (,$(findstring macosx,$(ALICE_TARGET))) PACKLDFLAGS:=$(LDFLAGS) $(@PACKAGE@LIBSINIT:%=-Wl,-u,_G__cpp_setupG__%) diff --git a/build/module.dep b/build/module.dep index b8b88a08d93..e53adae54d5 100644 --- a/build/module.dep +++ b/build/module.dep @@ -15,7 +15,7 @@ HBTP/module.mk: HBTP/libHBTP.pkg HERWIG/module.mk: HERWIG/libherwig.pkg HIJING/module.mk: HIJING/libhijing.pkg HLT/module.mk: HLT/libAliL3Src.pkg HLT/libAliL3Hough.pkg HLT/libAliL3Misc.pkg HLT/libAliL3Comp.pkg HLT/libAliL3ITS.pkg HLT/libAliL3MUON.pkg -ITS/module.mk: ITS/libITS.pkg +ITS/module.mk: ITS/libITSbase.pkg ITS/libITSsim.pkg ITS/libITSrec.pkg JETAN/module.mk: JETAN/libJETAN.pkg MEVSIM/module.mk: MEVSIM/libmevsim.pkg MICROCERN/module.mk: MICROCERN/libmicrocern.pkg diff --git a/macros/loadlibs.C b/macros/loadlibs.C index aaee19e4567..54a07880387 100644 --- a/macros/loadlibs.C +++ b/macros/loadlibs.C @@ -69,7 +69,9 @@ void loadlibs () gSystem->Load("libTPCrec"); gSystem->Load("libTPCsim"); gSystem->Load("libTPCfast"); - gSystem->Load("libITS"); + gSystem->Load("libITSbase"); + gSystem->Load("libITSsim"); + gSystem->Load("libITSrec"); gSystem->Load("libTRDbase"); gSystem->Load("libTRDsim"); gSystem->Load("libTRDrec"); -- 2.43.0