* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//
-// Base Class used to find
-// the reconstructed points for ITS
-// See also AliITSClusterFinderSPD, AliITSClusterFinderSDD,
-// AliITSClusterFinderSDD
-//
+////////////////////////////////////////////////////////////////////////////
+// //
+// Base Class used to find //
+// the reconstructed points for ITS //
+// See also AliITSClusterFinderSPD, AliITSClusterFinderSDD, //
+// AliITSClusterFinderSDD AliITSClusterFinderV2 //
+////////////////////////////////////////////////////////////////////////////
#include "AliITSClusterFinder.h"
-#include "AliITSdigitSPD.h"
-#include "AliITSdigitSDD.h"
-#include "AliITSdigitSSD.h"
+#include "AliITSRecPoint.h"
+#include "AliITSdigit.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSMap.h"
-#include "AliRun.h"
-#include "AliITS.h"
+#include "AliITSgeomTGeo.h"
ClassImp(AliITSClusterFinder)
fModule(0),
fDigits(0),
fNdigits(0),
-fResponse(0),
-fSegmentation(0),
+fDetTypeRec(0),
fClusters(0),
fNRawClusters(0),
fMap(0),
// A default constructed AliITSCulsterFinder
}
//----------------------------------------------------------------------
-AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg,
- AliITSresponse *res):
+AliITSClusterFinder::AliITSClusterFinder(AliITSDetTypeRec* dettyp):
TObject(),
fDebug(0),
fModule(0),
fDigits(0),
fNdigits(0),
-fResponse(res),
-fSegmentation(seg),
+fDetTypeRec(dettyp),
fClusters(0),
fNRawClusters(0),
fMap(0),
SetDeclusterFlag();
}
//----------------------------------------------------------------------
-AliITSClusterFinder::AliITSClusterFinder(AliITSsegmentation *seg,
- AliITSresponse *response,
- TClonesArray *digits):
+AliITSClusterFinder::AliITSClusterFinder(AliITSDetTypeRec* dettyp,
+ TClonesArray *digits):
TObject(),
fDebug(0),
fModule(0),
fDigits(digits),
fNdigits(0),
-fResponse(response),
-fSegmentation(seg),
+fDetTypeRec(dettyp),
fClusters(0),
fNRawClusters(0),
fMap(0),
SetClusterSize();
SetDeclusterFlag();
}
+
+//______________________________________________________________________
+AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source) : TObject(source),
+fDebug(source.fDebug),
+fModule(source.fModule),
+fDigits(),
+fNdigits(source.fNdigits),
+fDetTypeRec(),
+fClusters(),
+fNRawClusters(source.fNRawClusters),
+fMap(),
+fNperMax(source.fNperMax),
+fDeclusterFlag(source.fDeclusterFlag),
+fClusterSize(source.fClusterSize),
+fNPeaks(source.fNPeaks) {
+ // Copy constructor
+ // Copies are not allowed. The method is protected to avoid misuse.
+ AliError("Copy constructor not allowed\n");
+}
+
+
+//______________________________________________________________________
+//AliITSClusterFinder& AliITSClusterFinder::operator=(const AliITSClusterFinder& /* source */){
+ // Assignment operator
+ // Assignment is not allowed. The method is protected to avoid misuse.
+// Fatal("= operator","Assignment operator not allowed\n");
+// return *this;
+//}
+
//----------------------------------------------------------------------
AliITSClusterFinder::~AliITSClusterFinder(){
// destructor cluster finder
if(fMap) {delete fMap;}
// Zero local pointers. Other classes own these pointers.
- fSegmentation = 0;
- fResponse = 0;
fMap = 0;
fDigits = 0;
fNdigits = 0;
fDeclusterFlag= 0;
fClusterSize = 0;
fNPeaks = 0;
+ fDetTypeRec = 0;
+
}
//__________________________________________________________________________
-AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source) :
- TObject(source){
- // Copy Constructor
- // Input:
- // AliITSClusterFinder &source The class which will become a copy of
- // this class
- // Output:
- // none.
- // Return:
- // A copy of this class
-
- if(&source == this) return;
- *this = source;
- return;
+void AliITSClusterFinder::InitGeometry(){
+ //
+ // Initialisation of ITS geometry
+ //
+ Int_t mmax=AliITSgeomTGeo::GetNModules();
+ for (Int_t m=0; m<mmax; m++) {
+ Int_t lay,lad,det; AliITSgeomTGeo::GetModuleId(m,lay,lad,det);
+ fNdet[m] = (lad-1)*AliITSgeomTGeo::GetNDetectors(lay) + (det-1);
+ fNlayer[m] = lay-1;
+ }
}
-//______________________________________________________________________
-AliITSClusterFinder& AliITSClusterFinder::operator=(const AliITSClusterFinder
- &source) {
- // Assignment operator
- // Input:
- // AliITSClusterFinder &source The class which will become a copy of
- // this class
- // Output:
- // none.
- // Return:
- // A copy of this class
- if(&source == this) return *this;
- this->fDigits = source.fDigits;
- this->fNdigits = source.fNdigits;
- this->fResponse = source.fResponse;
- this->fSegmentation = source.fSegmentation;
- this->fNRawClusters = source.fNRawClusters;
- this->fMap = source.fMap;
- this->fNperMax = source.fNperMax;
- this->fDeclusterFlag = source.fDeclusterFlag;
- this->fClusterSize = source.fClusterSize;
- this->fNPeaks = source.fNPeaks;
- return *this;
-}
+
+
//----------------------------------------------------------------------
void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c){
// Add a raw cluster copy to the list
// Return:
// none.
- AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
- iTS->AddCluster(branch,c);
- fNRawClusters++;
+ if(!fDetTypeRec) {
+ Error("AddCluster","fDetTypeRec is null!");
+ return;
+ }
+ fDetTypeRec->AddCluster(branch,c);
+ fNRawClusters++;
}
//----------------------------------------------------------------------
void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c,
// none.
// Return:
// none.
+ if(!fDetTypeRec) {
+ Error("AddCluster","fDetTypeRec is null!");
+ return;
+ }
+
+ fDetTypeRec->AddCluster(branch,c);
+ fNRawClusters++;
+ fDetTypeRec->AddRecPoint(rp);
+
+}
+/*
+//______________________________________________________________________
+void AliITSClusterFinder::CheckLabels(Int_t lab[3]) {
+ //------------------------------------------------------------
+ // Tries to find mother's labels
+ //------------------------------------------------------------
+
+ if(lab[0]<0 && lab[1]<0 && lab[2]<0) return; // In case of no labels just exit
+ // Check if simulation
+ AliMC* mc = gAlice->GetMCApp();
+ if(!mc)return;
- AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
- iTS->AddCluster(branch,c);
- fNRawClusters++;
- iTS->AddRecPoint(rp);
+ Int_t ntracks = mc->GetNtrack();
+ for (Int_t i=0;i<3;i++){
+ Int_t label = lab[i];
+ if (label>=0 && label<ntracks) {
+ TParticle *part=(TParticle*)mc->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 AliITSClusterFinder::FindRawClusters(Int_t module){
// Default Cluster finder.
}
//______________________________________________________________________
-void AliITSClusterFinder::Print(ostream *os){
+void AliITSClusterFinder::Print(ostream *os) const{
//Standard output format for this class
// Inputs:
// ostream *os Output stream
*os << fNPeaks<<endl;
}
//______________________________________________________________________
-void AliITSClusterFinder::Read(istream *is){
+void AliITSClusterFinder::Read(istream *is) {
//Standard input for this class
// Inputs:
// istream *is Input stream