20 #include "AliCodeTimer.h"
40 #include <Riostream.h>
41 #include <TObjArray.h>
62 return Form(
"(X,Y)=(%7.3f,%7.3f) (DX,DY)=(%7.3f,%7.3f)",
75 fClusterFinder(clusterFinder),
76 fkTransformer(transformer),
78 fTriggerTrackStore(0x0),
116 AliCodeTimerAuto(Form(
"Chamber %d",chamberId),0);
124 AliError(
"Reconstruction parameters are missing: unable to clusterize");
132 Int_t nofAddedClusters(0);
133 Int_t fNCluster = clusterStore.
GetSize();
135 AliDebug(1,Form(
"chamberId = %2d NofClusters before = %d searchArea=%s",
136 chamberId,fNCluster,AsString(area).Data()));
145 static_cast<TObjArray*>(
fPads[1]->GetValue(detElemId))
148 if ( ( pads[0] && pads[0]->GetLast()>=0 ) ||
149 ( pads[1] && pads[1]->GetLast()>=0 ) )
156 ok =
Overlap(detElemId,area,deArea);
178 AliDebug(1,Form(
"Clusterizing DE %04d with %3d pads (cath0) and %3d pads (cath1)",
180 (pads[0] ? pads[0]->GetLast()+1 : 0),
181 (pads[1] ? pads[1]->GetLast()+1 : 0)));
195 if (nPad < 1) AliWarning(
"no pad attached to the cluster");
197 for (Int_t iPad=0; iPad<nPad; iPad++)
202 if (!pad->
IsReal())
continue;
215 rawCluster->
SetXYZ(xg, yg, zg);
224 AliDebug(1,Form(
"Adding RawCluster detElemId %4d mult %2d charge %e (xl,yl,zl)=(%e,%e,%e) (xg,yg,zg)=(%e,%e,%e) label %d",
234 AliDebug(1,Form(
"chamberId = %2d NofClusters after = %d",chamberId,fNCluster));
236 return nofAddedClusters;
250 if ( chamberId < 0 ) {
251 AliErrorStream() <<
"Cannot get chamberId from detElemId=" << detElemId << endl;
273 Bool_t overlap(kFALSE);
277 if (!globalDEArea)
return kFALSE;
281 if ( area.
Overlap(*globalDEArea) )
283 overlapArea = area.
Intersect(*globalDEArea);
292 AliDebug(1,Form(
"DE %04d area %s globalDEArea %s overlapArea %s deArea %s overlap=%d",
294 AsString(area).Data(),
295 AsString(*globalDEArea).Data(),
296 AsString(overlapArea).Data(),
297 AsString(deArea).Data(),
332 for ( Int_t i=0; i<2; i++ ) {
334 Int_t key; TObject* obj;
342 while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
344 if ( ! (d->
Charge() > 0.) )
continue;
346 Int_t ix = d->
PadX();
347 Int_t iy = d->
PadY();
358 padArray->SetOwner(kTRUE);
359 fPads[cathode]->
Add(detElemId,padArray);
367 mpad->SetUniqueID(d->GetUniqueID());
380 Int_t nTracks[2] = {0, 0};
382 for (Int_t iCath = 0; iCath < 2; iCath++) {
387 if (digit[iCath]) nTracks[iCath] = digit[iCath]->
Ntracks();
391 if (nTracks[0] + nTracks[1] == 0)
return -1;
394 Int_t* trackId =
new Int_t[nTracks[0] + nTracks[1]];
395 Float_t* trackCharge =
new Float_t[nTracks[0] + nTracks[1]];
396 Int_t nTracksTot = 0;
399 for (Int_t iTrack1 = 0; iTrack1 < nTracks[0]; iTrack1++) {
400 trackId[iTrack1] = digit[0]->
Track(iTrack1);
401 trackCharge[iTrack1] = digit[0]->
TrackCharge(iTrack1);
403 nTracksTot = nTracks[0];
406 for (Int_t iTrack2 = 0; iTrack2 < nTracks[1]; iTrack2++) {
407 Int_t trackId2 = digit[1]->
Track(iTrack2);
409 Bool_t trackExist = kFALSE;
410 for (Int_t iTrack1 = 0; iTrack1 < nTracks[0]; iTrack1++) {
411 if (trackId2 == trackId[iTrack1]) {
413 trackCharge[iTrack1] += digit[1]->
TrackCharge(iTrack2);
420 trackId[nTracksTot] = trackId2;
421 trackCharge[nTracksTot] = digit[1]->
TrackCharge(iTrack2);
427 Int_t mainTrackId = -1;
428 Float_t maxCharge = 0.;
429 for (Int_t iTrack = 0; iTrack < nTracksTot; iTrack++) {
430 if (trackCharge[iTrack] > maxCharge) {
431 mainTrackId = trackId[iTrack];
432 maxCharge = trackCharge[iTrack];
437 delete[] trackCharge;
461 cout << Form(
"---- DE %04d",detElemId) << endl;
463 for ( Int_t cathode = 0; cathode < 2; ++cathode )
465 cout << Form(
" -- Cathode %1d",cathode) << endl;
471 cout <<
"no pad array" << endl;
473 else if ( padArray->GetLast() < 0 )
475 cout <<
"no pads" << endl;
479 TIter next(padArray);
481 while ( ( pad = static_cast<AliMUONPad*>(next()) ) )
virtual ~AliMUONSimpleClusterServer()
Bool_t IsReal() const
Return info whether this is a real pad or a virtual one.
The iterator over detection elements.
Interface of a cluster finder.
const AliMpVSegmentation * GetMpSegmentation(Int_t detElemId, AliMp::CathodType cath, Bool_t warn=true) const
virtual void AddDigitId(UInt_t id)=0
Add a digit Id to the array of associated digits.
Double_t GetDimensionY() const
Return y dimensions.
virtual Int_t PadY() const =0
The y-index of this digit (>=0)
virtual Float_t TrackCharge(Int_t) const
Return the i-th track charge.
Interface for a digit container.
Int_t GenerateClusters(Int_t iChamber, AliMUONVClusterStore &clusterStore) const
Double_t LowestPadCharge() const
Get the lowest charge we allow for pads.
Double_t GetPositionY() const
Return y position.
static AliMpSegmentation * Instance(Bool_t warn=true)
A group of adjacent pads.
Double_t GetDefaultNonBendingReso(Int_t iCh) const
Get the default non bending resolution of chamber iCh.
AliMUONVDigitStore * fDigitStore
! the digit store (not owner)
Interface of a cluster finder for combined tracking.
virtual Int_t GetSize() const =0
The number of objects stored.
Int_t FindMCLabel(const AliMUONCluster &cluster, Int_t detElemId, const AliMpVSegmentation *seg[2]) const
void SetSaturated(Bool_t val)
Set info whether this pad is saturated or not.
virtual Int_t Track(Int_t) const
Return the i-th track number.
A rectangle area positioned in plane..
Int_t CurrentDEId() const
AliMpExMapIterator * fPadsIterator[2]
iterator for the map of TClonesArray of AliMUONPads
Bool_t Overlap(Int_t detElemId, const AliMpArea &area, AliMpArea &deArea) const
Class with MUON reconstruction parameters.
Int_t Multiplicity() const
virtual Float_t Charge() const =0
The charge of this digit, calibrated or not depending on IsCalibrated()
virtual void SetErrXY(Double_t errX, Double_t errY)=0
Set resolution (cm) on coordinates (X,Y)
virtual Bool_t Prepare(Int_t detElemId, TObjArray *pads[2], const AliMpArea &area)
virtual Bool_t NeedSegmentation() const
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning=true) const =0
Find pad by indices.
virtual Int_t DetElemId() const =0
The detection element this digit belongs to.
Double_t LowestClusterCharge() const
Get the lowest possible cluster charge.
AliMUONVClusterFinder * fClusterFinder
! the cluster finder (owner)
Int_t GetManuChannel() const
virtual Bool_t Add(TObject *object)
Add an object to the store.
virtual void SetXYZ(Double_t x, Double_t y, Double_t z)=0
Set coordinates (cm)
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
abstract base class for clusters
Int_t Clusterize(Int_t chamberId, AliMUONVClusterStore &clusterStore, const AliMpArea &area, const AliMUONRecoParam *recoParam=0x0)
Find and add clusters from a given region of a given chamber to the store.
Implementation of AliMUONVClusterServer interface.
AliMUONTriggerTrackToTrackerClusters * fBypass
to convert trigger track into tracker clusters (owner)
Double_t GetDimensionX() const
Return x dimensions.
virtual Int_t Cathode() const =0
Cathode number this digit is on (0 or 1)
AliMpArea Intersect(const AliMpArea &area) const
virtual void SetMCLabel(Int_t label)=0
Set the corresponding MC track number.
Double_t GetPositionY() const
Return the pad x position (in cm)
virtual Int_t GetNDigits() const =0
Return number of associated digits.
Interface of a cluster container.
TObject * GetValue(Int_t keyFirst, Int_t keySecond) const
AliMpExMap * fPads[2]
map of TClonesArray of AliMUONPads
Double_t GetDefaultBendingReso(Int_t iCh) const
Get the default bending resolution of chamber iCh.
virtual void SetChargeHints(Double_t, Double_t)
AliMp::CathodType GetCathodType(Int_t cathodNumber)
Convert integer number in enum;.
Base class of a trigger track store.
Double_t GetPositionX() const
Return x position.
AliMUONVTriggerTrackStore * fTriggerTrackStore
trigger track store (if bypassing of St45 was requested) (not owner)
virtual Int_t PadX() const =0
The x-index of this digit (>=0)
void Add(Int_t keyFirst, Int_t keySecond, TObject *object)
virtual void SetChi2(Double_t chi2)=0
Set chi2 of cluster.
TVector2 Position() const
Return (x,y) of that cluster.
virtual Bool_t IsTracker() const
Whether this digit is a tracker digit (false if belongs to trigger)
TObjArray * PadArray(Int_t detElemId, Int_t cathode) const
Bool_t IsValid() const
Return validity.
virtual AliMpPad PadByPosition(Double_t x, Double_t y, Bool_t warning=true) const =0
Find pad by position.
Convertor of trigger track to tracker clusters.
virtual void SetCharge(Double_t charge)=0
Set the cluster charge.
void Print(Option_t *opt="") const
virtual AliMUONCluster * NextCluster()=0
The abstract base class for the segmentation.
void Global2Local(Int_t detElemId, const AliMpArea &globalArea, AliMpArea &localArea) const
Double_t GetDimensionY() const
Return the y pad dimension - half length (in cm)
virtual Int_t Ntracks() const
Number of tracks contributing to this digit.
static Float_t * DefaultChamberZ()
Return pointer to array of positions.
Bool_t IsValid() const
Return validity.
void UseDigits(TIter &next, AliMUONVDigitStore *digitStore=0x0)
Specify an iterator to loop over the digits needed to perform our job.
void Print(Option_t *opt="") const
Class which encapsuate all information about a pad.
virtual Bool_t IsSaturated() const =0
Whether the ADC has saturated.
Bool_t Overlap(const AliMpArea &area) const
Double_t GetPositionX() const
Return the pad x position (in cm)
const AliMUONGeometryTransformer & fkTransformer
! the geometry transformer (not owner)
virtual AliMUONVDigit * FindObject(const TObject *object) const
Find an object (default is to forward to FindObject(object->GetUniqueID())
virtual Bool_t HasMCInformation() const =0
Whether we have any MC related information (e.g. at least one simulated digit)
virtual Double_t GetCharge() const =0
Set the cluster charge.
AliMUONSimpleClusterServer(AliMUONVClusterFinder *clusterFinder, const AliMUONGeometryTransformer &transformer)
AliMUONPad * Pad(Int_t index) const
Double_t GetDimensionX() const
Return the x pad dimension - half length (in cm)
virtual Bool_t UseTriggerTrackStore(AliMUONVTriggerTrackStore *trackStore)
Use trigger tracks. Return kFALSE if not used.
Helper class making Root persistent TExMap.
Combination of digit and mppad informations.
AliMpExMapIterator * CreateIterator() const
Float_t Chi2() const
Return chi2 of the RawCharge fit (if any)
virtual Int_t GetMCLabel() const =0
Return the corresponding MC track number.