#include "AliMpDEIterator.h"
#include "AliMpDEManager.h"
#include "AliMpExMap.h"
+#include "AliMpExMapIterator.h"
#include "AliMpPad.h"
#include "AliMpSegmentation.h"
#include "AliMpVSegmentation.h"
#include <Riostream.h>
-#include <TClonesArray.h>
+#include <TObjArray.h>
#include <TString.h>
#include <float.h>
///
/// \author Laurent Aphecetche, Subatech
+using std::endl;
+using std::cout;
/// \cond CLASSIMP
ClassImp(AliMUONSimpleClusterServer)
/// \endcond
fPads[0] = new AliMpExMap;
fPads[1] = new AliMpExMap;
+ fPadsIterator[0] = fPads[0]->CreateIterator();
+ fPadsIterator[1] = fPads[1]->CreateIterator();
}
//_____________________________________________________________________________
delete fClusterFinder;
delete fPads[0];
delete fPads[1];
+ delete fPadsIterator[0];
+ delete fPadsIterator[1];
delete fBypass;
}
/// We first find out the list of DE that have a non-zero overlap with area,
/// and then use the clusterfinder to find clusters in those areas (and DE).
- AliCodeTimerAuto(Form("Chamber %d",chamberId),);
+ AliCodeTimerAuto(Form("Chamber %d",chamberId),0);
if ( fTriggerTrackStore && chamberId >= 6 )
{
{
Int_t detElemId = it.CurrentDEId();
- TClonesArray* pads[2] =
+ TObjArray* pads[2] =
{
- static_cast<TClonesArray*>(fPads[0]->GetValue(detElemId)),
- static_cast<TClonesArray*>(fPads[1]->GetValue(detElemId))
+ static_cast<TObjArray*>(fPads[0]->GetValue(detElemId)),
+ static_cast<TObjArray*>(fPads[1]->GetValue(detElemId))
};
if ( ( pads[0] && pads[0]->GetLast()>=0 ) ||
{ AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::kCath0),
AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::kCath1)
};
+
+ fClusterFinder->SetChargeHints(recoParam->LowestPadCharge(),
+ recoParam->LowestClusterCharge());
+
if ( fClusterFinder->NeedSegmentation() )
{
fClusterFinder->Prepare(detElemId,pads,deArea,seg);
Double_t xl,yl,zl;
- Double_t zg = AliMUONConstants::DefaultChamberZ(AliMpDEManager::GetChamberId(detElemId));
+ Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
+ if ( chamberId < 0 ) {
+ AliErrorStream() << "Cannot get chamberId from detElemId=" << detElemId << endl;
+ return;
+ }
+ Double_t zg = AliMUONConstants::DefaultChamberZ(chamberId);
fkTransformer.Global2Local(detElemId,
globalArea.GetPositionX(),globalArea.GetPositionY(),zg,
}
//_____________________________________________________________________________
-TClonesArray*
+TObjArray*
AliMUONSimpleClusterServer::PadArray(Int_t detElemId, Int_t cathode) const
{
/// Return array for given cathode of given DE
- return static_cast<TClonesArray*>(fPads[cathode]->GetValue(detElemId));
+ return static_cast<TObjArray*>(fPads[cathode]->GetValue(detElemId));
}
//_____________________________________________________________________________
fDigitStore = digitStore;
- fPads[0]->Clear();
- fPads[1]->Clear();
-
+ // Clear pads arrays in the maps
+ for ( Int_t i=0; i<2; i++ ) {
+ fPadsIterator[i]->Reset();
+ Int_t key; TObject* obj;
+ while ( ( obj = fPadsIterator[i]->Next(key) ) ) {
+ //cout << "clearing array for detElemId " << key << " ";
+ obj->Clear();
+ }
+ }
+
AliMUONVDigit* d;
while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
{
if ( ! d->Charge() > 0 ) continue; // skip void digits.
+ if ( ! d->IsTracker() ) continue; // skip trigger digits
Int_t ix = d->PadX();
Int_t iy = d->PadY();
Int_t cathode = d->Cathode();
GetMpSegmentation(detElemId,AliMp::GetCathodType(cathode));
AliMpPad pad = seg->PadByIndices(ix,iy);
- TClonesArray* padArray = PadArray(detElemId,cathode);
+ TObjArray* padArray = PadArray(detElemId,cathode);
if (!padArray)
{
- padArray = new TClonesArray("AliMUONPad",100);
+ padArray = new TObjArray(100);
+ padArray->SetOwner(kTRUE);
fPads[cathode]->Add(detElemId,padArray);
}
- AliMUONPad mpad(detElemId,cathode,
+ AliMUONPad* mpad = new AliMUONPad(detElemId,cathode,
ix,iy,pad.GetPositionX(),pad.GetPositionY(),
pad.GetDimensionX(),pad.GetDimensionY(),
d->Charge());
- if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE);
- mpad.SetUniqueID(d->GetUniqueID());
- new ((*padArray)[padArray->GetLast()+1]) AliMUONPad(mpad);
+ if ( d->IsSaturated() ) mpad->SetSaturated(kTRUE);
+ mpad->SetUniqueID(d->GetUniqueID());
+ padArray->Add(mpad);
}
}
{
cout << Form(" -- Cathode %1d",cathode) << endl;
- TClonesArray* padArray = PadArray(detElemId,cathode);
+ TObjArray* padArray = PadArray(detElemId,cathode);
if (!padArray)
{