25 #include "TObjArray.h" 26 #include "TClonesArray.h" 54 fApplyMisalignment(kFALSE),
61 for (Int_t iPlane=0; iPlane<fNMaxPlanes; iPlane++) fClustersPerPlane[iPlane] = NULL;
62 fDigitsInCluster =
new TClonesArray(
"AliMFTDigit", fNMaxDigitsPerCluster);
63 fDigitsInCluster -> SetOwner(kTRUE);
64 fStopWatch =
new TStopwatch();
65 fStopWatch -> Reset();
74 AliDebug(1,
"Deleting AliMFTClusterFinder...");
76 for (Int_t iPlane=0; iPlane<
fNMaxPlanes; iPlane++) {
91 AliDebug(1,
"Clearing AliMFTClusterFinder...");
93 for (Int_t iPlane=0; iPlane<
fNMaxPlanes; iPlane++) {
121 for (Int_t iPlane=0; iPlane<
fNPlanes; iPlane++) {
137 AliInfo(
"Starting Clusterization for MFT");
144 Bool_t isDigAvailableForNewCluster = kTRUE;
146 TClonesArray *myDigitList = 0;
152 AliDebug(1, Form(
"Plane %02d : # Det Elem = %d ", iPlane,nDetElem));
154 TClonesArray *clustersPerDetElem[nDetElem];
155 for (Int_t iDetElem=0; iDetElem<nDetElem; iDetElem++) clustersPerDetElem[iDetElem] =
new TClonesArray(
"AliMFTCluster");
157 myDigitList = (TClonesArray*) pDigitList->At(iPlane);
159 AliInfo( Form(
"myDigitList->GetEntries() = %d", myDigitList->GetEntries()));
161 Int_t cycleOverDigits = 0;
162 Double_t myCutForAvailableDigits = 0;
164 Int_t currentDetElem = -1;
165 Int_t currentDetElemLocal = -1;
166 Bool_t areThereSkippedDigits = kFALSE;
170 while (myDigitList->GetEntries()) {
172 for (Int_t iDig=0; iDig<myDigitList->GetEntries(); iDig++) {
187 myCutForAvailableDigits -= 0.5;
189 areThereSkippedDigits = kFALSE;
192 areThereSkippedDigits = kTRUE;
196 isDigAvailableForNewCluster = kTRUE;
198 for (Int_t iCluster=0; iCluster<clustersPerDetElem[currentDetElemLocal]->GetEntries(); iCluster++) {
203 myDigitList->Compress();
205 isDigAvailableForNewCluster = kFALSE;
209 areThereSkippedDigits = kTRUE;
210 isDigAvailableForNewCluster=kFALSE;
214 if (isDigAvailableForNewCluster) {
218 myDigitList->Compress();
220 new ((*clustersPerDetElem[currentDetElemLocal])[clustersPerDetElem[currentDetElemLocal]->GetEntries()])
AliMFTCluster(*newCluster);
230 AliInfo(Form(
"Plane %d: clusters found in %f seconds\n",iPlane,
fStopWatch->CpuTime()));
235 Double_t misalignmentPhi = 2.*TMath::Pi()*gRandom->Rndm();
240 for (Int_t iDetElem=0; iDetElem<nDetElem; iDetElem++) {
241 for (Int_t iCluster=0; iCluster<clustersPerDetElem[iDetElem]->GetEntries(); iCluster++) {
242 newCluster = (
AliMFTCluster*) (clustersPerDetElem[iDetElem]->At(iCluster));
243 newCluster -> TerminateCluster();
245 newCluster -> SetClusterEditable(kTRUE);
246 newCluster -> SetX(newCluster->
GetX()+misalignmentX);
247 newCluster -> SetY(newCluster->
GetY()+misalignmentY);
248 newCluster -> SetClusterEditable(kFALSE);
256 for (Int_t iDetElem=0; iDetElem<nDetElem; iDetElem++) {
257 clustersPerDetElem[iDetElem] -> Delete();
258 delete clustersPerDetElem[iDetElem];
261 myDigitList -> Delete();
273 AliDebug(1,
"Making Cluster Branch");
278 for(Int_t iPlane=0; iPlane<
fNPlanes; iPlane++) {
279 AliDebug(1, Form(
"Setting Branch Plane_%02d for treeCluster",iPlane));
280 if (treeCluster->GetBranch(Form(
"Plane_%02d",iPlane)))
continue;
281 AliDebug(1, Form(
"Branch Plane_%02d does not exist, creating!",iPlane));
294 if (treeCluster && treeCluster->GetBranch(
"Plane_00")) {
296 for(Int_t iPlane=0; iPlane<
fNPlanes; iPlane++) {
297 if (treeCluster->GetBranch(Form(
"Plane_%02d",iPlane))) {
298 treeCluster->SetBranchAddress(Form(
"Plane_%02d",iPlane), &(
fClustersPerPlane[iPlane]));
300 else AliError(Form(
"No branch available with name Plane_%02d", iPlane));
316 for(Int_t iPlane=0; iPlane<
fNPlanes; iPlane++) {
317 AliDebug(1, Form(
"plane %02d", iPlane));
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Int_t GetDetElemID() const
static const Double_t fCutForAttachingDigits
TClonesArray * fClustersPerPlane[fNMaxPlanes]
static const Double_t fCutForAttachingDigits
AliMFTDigit * fCurrentDigit
void MakeClusterBranch(TTree *treeCluster)
void SetClusterTreeAddress(TTree *treeCluster)
AliMFTSegmentation * GetSegmentation() const
Returns pointer to the segmentation.
static const Double_t fCutForAvailableDigits
void Print(const char *method, TStopwatch &timer, Int_t n)
static const Double_t fMisalignmentMagnitude
Double_t GetDistanceFromPixel(AliMFTDigit *pixel)
static const Int_t fNMaxPlanes
static AliMFTGeometry * Instance()
Retuns MFT Geometry singleton object.
#define AliCodeTimerAuto(message, counter)
Bool_t fApplyMisalignment
void DigitsToClusters(const TObjArray *pDigitList)
AliMFTSegmentation * fSegmentation
virtual void Clear(const Option_t *)
static const Double_t fMisalignmentMagnitude
#define AliDebug(logLevel, message)
TClonesArray * fDigitsInCluster
[fNPlanes] list of clusters [per plane]
Bool_t AddPixel(AliMFTDigit *pixel)
Int_t GetDiskNSensors(Int_t diskId) const
Returns the number of sensors on the entire disk (top+bottom)
AliMFTCluster * fCurrentCluster
#define AliError(message)
static const Int_t kNDisks
Number of Disk.
static const Double_t fCutForAvailableDigits
Int_t GetDetElemLocalID(Int_t detElem) const
Returns the local ID of the sensor on the disk.
Class Handling both Virutal Segmentation and Real Volumes.
void Init(const Char_t *nameGeomFile)