//_____________________________________________________________________________
Bool_t
-AliMUONClusterFinderCOG::Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderCOG::Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area)
{
/// Prepare for clustering
- // Find out the DetElemId
- Int_t detElemId(-1);
-
- TIter next(digitStore.CreateIterator());
- AliMUONVDigit* d;
-
- d = static_cast<AliMUONVDigit*>(next());
-
- if (d)
- {
- detElemId = d->DetElemId();
- }
-
- if ( detElemId < 0 )
- {
- AliWarning("Could not find DE. Probably no digits at all ?");
- return kFALSE;
- }
-
- return fPreClusterFinder->Prepare(segmentations,digitStore);
+ return fPreClusterFinder->Prepare(detElemId,pads,area);
}
//_____________________________________________________________________________
public:
AliMUONClusterFinderCOG(AliMUONVClusterFinder* clusterFinder);
virtual ~AliMUONClusterFinderCOG();
+
+ using AliMUONVClusterFinder::Prepare;
- virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore);
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area);
virtual AliMUONCluster* NextCluster();
//_____________________________________________________________________________
Bool_t
-AliMUONClusterFinderMLEM::Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderMLEM::Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* seg[2])
{
/// Prepare for clustering
// AliCodeTimerAuto("")
for ( Int_t i = 0; i < 2; ++i )
{
- fSegmentation[i] = segmentations[i];
+ fSegmentation[i] = seg[i];
}
// Find out the DetElemId
- fDetElemId = -1;
-
- TIter next(digitStore.CreateIterator());
- AliMUONVDigit* d = static_cast<AliMUONVDigit*>(next());
-
- if (d)
- {
- fDetElemId = d->DetElemId();
- }
-
- if ( fDetElemId < 0 )
- {
- AliWarning("Could not find DE. Probably no digits at all ?");
- return kFALSE;
- }
+ fDetElemId = detElemId;
delete fSplitter;
fSplitter = new AliMUONClusterSplitterMLEM(fDetElemId,fPixArray);
AliDebug(3,Form("EVT %d DE %d",fEventNumber,fDetElemId));
- return fPreClusterFinder->Prepare(segmentations,digitStore);
+ if ( fPreClusterFinder->NeedSegmentation() )
+ {
+ return fPreClusterFinder->Prepare(detElemId,pads,area,seg);
+ }
+ else
+ {
+ return fPreClusterFinder->Prepare(detElemId,pads,area);
+ }
}
//_____________________________________________________________________________
/// Check precluster in order to attempt to simplify it (mostly for
/// two-cathode preclusters)
- // AliCodeTimerAuto("")
+ AliCodeTimerAuto("")
// Disregard small clusters (leftovers from splitting or noise)
if ((origCluster.Multiplicity()==1 || origCluster.Multiplicity()==2) &&
return 0x0;
}
- //AliMUONCluster* cluster = static_cast<AliMUONCluster*>(origCluster.Clone());
AliMUONCluster* cluster = new AliMUONCluster(origCluster);
AliDebug(2,"Start of CheckPreCluster=");
AliMUONClusterFinderMLEM(Bool_t plot, AliMUONVClusterFinder* clusterFinder); // Constructor
virtual ~AliMUONClusterFinderMLEM(); // Destructor
- virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore);
+ virtual Bool_t NeedSegmentation() const { return kTRUE; }
+
+ using AliMUONVClusterFinder::Prepare;
+
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* segmentations[2]);
virtual AliMUONCluster* NextCluster();
//_____________________________________________________________________________
Bool_t
-AliMUONClusterFinderSimpleFit::Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore)
+AliMUONClusterFinderSimpleFit::Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area)
{
/// Prepare for clustering
// FIXME: should we get the Mathieson from elsewhere ?
// Find out the DetElemId
- Int_t detElemId(-1);
-
- TIter next(digitStore.CreateIterator());
- AliMUONVDigit* d = static_cast<AliMUONVDigit*>(next());
-
- if (d)
- {
- detElemId = d->DetElemId();
- }
- else
- {
- AliWarning("Could not find DE. Probably no digits at all : here's the digitStore :");
- StdoutToAliWarning(digitStore.Print(););
- return kFALSE;
- }
-
AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
Float_t kx3 = AliMUONConstants::SqrtKx3();
fMathieson->SetSqrtKx3AndDeriveKx2Kx4(kx3);
fMathieson->SetSqrtKy3AndDeriveKy2Ky4(ky3);
- return fClusterFinder->Prepare(segmentations,digitStore);
+ return fClusterFinder->Prepare(detElemId,pads,area);
}
//_____________________________________________________________________________
AliMUONClusterFinderSimpleFit(AliMUONVClusterFinder* clusterFinder);
virtual ~AliMUONClusterFinderSimpleFit();
- virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore);
+ using AliMUONVClusterFinder::Prepare;
+
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area);
virtual AliMUONCluster* NextCluster();
: AliMUONVClusterFinder(),
fClusters(0x0),
fSegmentations(0x0),
+ fPads(0x0),
fDetElemId(0)
{
/// ctor
- for ( Int_t i = 0; i < 2; ++i )
- {
- fPads[i] = 0x0;
- }
}
//_____________________________________________________________________________
AliMUONPreClusterFinderV2::~AliMUONPreClusterFinderV2()
{
- /// dtor : note we're owner of the pads and the clusters, but not of
- /// the remaining objects (digits, segmentations)
+ /// dtor : note we're owner of the clusters, but not of the pads
delete fClusters;
- for ( Int_t i = 0; i < 2; ++i )
- {
- delete fPads[i];
- }
}
//_____________________________________________________________________________
//_____________________________________________________________________________
Bool_t
-AliMUONPreClusterFinderV2::Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore)
-// FIXME : add area on which to look for clusters here.
+AliMUONPreClusterFinderV2::Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* seg[2])
{
/// Prepare for clustering, by giving access to segmentations and digit lists
- fSegmentations = segmentations;
-
- delete fClusters;
- fClusters = new TClonesArray("AliMUONCluster");
- for ( Int_t i = 0; i < 2; ++i )
+ if ( area.IsValid() )
{
- delete fPads[i];
- fPads[i] = new TClonesArray("AliMUONPad");
+ AliError("Handling of area not yet implemented for this class. Please check");
}
- fDetElemId = -1;
+ delete fClusters;
+ fClusters = new TClonesArray("AliMUONCluster");
+
+ fPads = pads;
+ fSegmentations = seg;
- TIter next(digitStore.CreateIterator());
- AliMUONVDigit* d;
+ fDetElemId = detElemId;
- while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
- {
- Int_t ix = d->PadX();
- Int_t iy = d->PadY();
- Int_t cathode = d->Cathode();
- AliMpPad pad = fSegmentations[cathode]->PadByIndices(AliMpIntPair(ix,iy));
- TClonesArray& padArray = *(fPads[cathode]);
- if ( fDetElemId == -1 )
- {
- fDetElemId = d->DetElemId();
- }
- else
- {
- if ( d->DetElemId() != fDetElemId )
- {
- AliError("Something is seriously wrong with DE. Aborting clustering");
- return kFALSE;
- }
- }
-
- AliMUONPad mpad(fDetElemId,cathode,
- ix,iy,pad.Position().X(),pad.Position().Y(),
- pad.Dimensions().X(),pad.Dimensions().Y(),
- d->Charge());
- if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE);
- mpad.SetUniqueID(d->GetUniqueID());
- new (padArray[padArray.GetLast()+1]) AliMUONPad(mpad);
- }
if ( fPads[0]->GetLast() < 0 && fPads[1]->GetLast() < 0 )
{
// no pad at all, nothing to do...
AliMUONPreClusterFinderV2();
virtual ~AliMUONPreClusterFinderV2();
- virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore);
+ Bool_t NeedSegmentation() const { return kTRUE; }
+
+ using AliMUONVClusterFinder::Prepare;
+
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* seg[2]);
virtual AliMUONCluster* NextCluster();
private:
TClonesArray* fClusters; //!< the clusters we've found (owner)
const AliMpVSegmentation** fSegmentations; //!< segmentations (not owner)
- TClonesArray* fPads[2]; //!< the pads corresponding to the digits (owner)
+ TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
Int_t fDetElemId; //!< which DE we're considering
- ClassDef(AliMUONPreClusterFinderV2,1) // A basic pre-cluster finder
+ ClassDef(AliMUONPreClusterFinderV2,2) // A basic pre-cluster finder
};
#endif
: AliMUONVClusterFinder(),
fClusters(new TClonesArray("AliMUONCluster",10)),
fSegmentations(0x0),
+ fPads(0x0),
fDetElemId(0),
fIterator(0x0)
{
AliInfo("")
for ( Int_t i = 0; i < 2; ++i )
{
- fPads[i] = new TClonesArray("AliMUONPad",100);
fPreClusters[i] = new TClonesArray("AliMUONCluster",10);
}
}
//_____________________________________________________________________________
AliMUONPreClusterFinderV3::~AliMUONPreClusterFinderV3()
{
- /// dtor : note we're owner of the pads and the clusters, but not of
- /// the remaining objects (digits, segmentations)
+ /// dtor
delete fClusters;
for ( Int_t i = 0; i < 2; ++i )
{
- delete fPads[i];
delete fPreClusters[i];
}
}
//_____________________________________________________________________________
Bool_t
-AliMUONPreClusterFinderV3::Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore)
+AliMUONPreClusterFinderV3::Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* seg[2])
{
/// Prepare for clustering, by giving access to segmentations and digit lists
- // FIXME : add area on which to look for clusters here.
- fSegmentations = segmentations;
+ if ( area.IsValid() )
+ {
+ AliError("Handling of area not yet implemented for this class. Please check.");
+ }
+
+ fSegmentations = seg;
+ fPads = pads;
fClusters->Clear("C");
for ( Int_t i = 0; i < 2; ++i )
{
- fPads[i]->Clear("C");
fPreClusters[i]->Clear("C");
}
- fDetElemId = -1;
-
- TIter next(digitStore.CreateIterator());
- AliMUONVDigit* d;
+ fDetElemId = detElemId;
- while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
- {
- Int_t ix = d->PadX();
- Int_t iy = d->PadY();
- Int_t cathode = d->Cathode();
- AliMpPad pad = fSegmentations[cathode]->PadByIndices(AliMpIntPair(ix,iy));
- TClonesArray& padArray = *(fPads[cathode]);
- if ( fDetElemId == -1 )
- {
- fDetElemId = d->DetElemId();
- }
- else
- {
- if ( d->DetElemId() != fDetElemId )
- {
- AliError("Something is seriously wrong with DE. Aborting clustering");
- return kFALSE;
- }
- }
-
- AliMUONPad mpad(fDetElemId,cathode,
- ix,iy,pad.Position().X(),pad.Position().Y(),
- pad.Dimensions().X(),pad.Dimensions().Y(),
- d->Charge());
- if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE);
- mpad.SetUniqueID(d->GetUniqueID());
- new (padArray[padArray.GetLast()+1]) AliMUONPad(mpad);
- }
if ( fPads[0]->GetLast() < 0 && fPads[1]->GetLast() < 0 )
{
// no pad at all, nothing to do...
AliMUONPreClusterFinderV3();
virtual ~AliMUONPreClusterFinderV3();
- virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore);
+ virtual Bool_t NeedSegmentation() const { return kTRUE; }
+
+ using AliMUONVClusterFinder::Prepare;
+
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* seg[2]);
virtual AliMUONCluster* NextCluster();
private:
TClonesArray* fClusters; //!< the clusters we've found (owner)
const AliMpVSegmentation** fSegmentations; //!< segmentations (not owner)
- TClonesArray* fPads[2]; //!< the pads corresponding to the digits (owner)
+ TClonesArray** fPads; //!< the pads corresponding to the digits (not owner)
TClonesArray* fPreClusters[2]; //!< the preclusters per cathode (owner)
Int_t fDetElemId; //!< which DE we're considering
TIterator* fIterator; //!< iterator on fClusters
- ClassDef(AliMUONPreClusterFinderV3,1) // A basic pre-cluster finder
+ ClassDef(AliMUONPreClusterFinderV3,2) // A basic pre-cluster finder
};
#endif
/// Destructor
}
+//_____________________________________________________________________________
+Bool_t
+AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
+ TClonesArray* /*pads*/[2],
+ const AliMpArea& /*area*/)
+{
+/// Not implemented
+
+ AliError("Not implemented");
+ return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONVClusterFinder::Prepare(Int_t /*detElemId*/,
+ TClonesArray* /*pads*/[2],
+ const AliMpArea& /*area*/,
+ const AliMpVSegmentation* /*segmentations*/[2])
+{
+/// Not implemented
+
+ AliError("Not implemented");
+ return kFALSE;
+}
+
//_____________________________________________________________________________
Bool_t
AliMUONVClusterFinder::UsePad(const AliMUONPad&)
{
+/// Not implemented
+
AliError("Not implemented");
return kFALSE;
}
class AliMUONCluster;
class AliMpVSegmentation;
class AliMUONPad;
-class AliMUONVDigitStore;
+class AliMpArea;
class AliMUONVClusterFinder : public TObject
{
virtual ~AliMUONVClusterFinder();
/// \todo add comment
- virtual Bool_t Prepare(const AliMpVSegmentation* segmentations[2],
- const AliMUONVDigitStore& digitStore) = 0;
+
+ virtual Bool_t NeedSegmentation() const { return kFALSE; }
+
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area);
+
+ virtual Bool_t Prepare(Int_t detElemId,
+ TClonesArray* pads[2],
+ const AliMpArea& area,
+ const AliMpVSegmentation* segmentations[2]);
/// \todo add comment
virtual AliMUONCluster* NextCluster() = 0;