* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
//_________________________________________________________________________
// Implementation version 1 of algorithm class to construct PHOS track segments
// Associates EMC and PPSD clusters
#include "AliPHOSTrackSegmentMakerv1.h"
#include "AliPHOSIndexToObject.h"
#include "AliPHOSTrackSegment.h"
+#include "AliPHOSCpvRecPoint.h"
#include "AliPHOSLink.h"
#include "AliPHOSv0.h"
#include "AliRun.h"
fR0 = 10. ;
//clusters are sorted in "rows" and "columns" of width geom->GetCrystalSize(0),
fDelta = fR0 + fGeom->GetCrystalSize(0) ;
- fMinuit = new TMinuit(100) ;
+ if(!gMinuit) gMinuit = new TMinuit(100) ;
fUnfoldFlag = kTRUE ;
}
AliPHOSTrackSegmentMakerv1::~AliPHOSTrackSegmentMakerv1()
{
// dtor
-
- delete fMinuit ;
}
//____________________________________________________________________________
{
// Calls TMinuit to fit the energy distribution of a cluster with several maxima
+ gMinuit->mncler(); // Reset Minuit list of paramters
gMinuit->SetPrintLevel(-1) ; // No Printout
gMinuit->SetFCN(UnfoldingChiSquare) ; // To set the address of the minimization function
gMinuit->SetObjectFit(emcRP) ; // To tranfer pointer to UnfoldingChiSquare
Double_t p1 = 1.0 ;
Double_t p2 = 0.0 ;
- gMinuit->mnexcm("SET STR", &p2, 0, ierflg) ; // force TgMinuit to reduce function calls
+ gMinuit->mnexcm("SET STR", &p2, 0, ierflg) ; // force TMinuit to reduce function calls
gMinuit->mnexcm("SET GRA", &p1, 1, ierflg) ; // force TMinuit to use my gradient
gMinuit->SetMaxIterations(5);
gMinuit->mnexcm("SET NOW", &p2 , 0, ierflg) ; // No Warnings
Int_t & emcStopedAt,
Int_t & ppsdStopedAt)
{
- // Fill xxxOut arrays with clusters from one PHOS module EMC+PPSD
+ // Fill xxxOut arrays with clusters from one PHOS module
AliPHOSEmcRecPoint * emcRecPoint ;
AliPHOSPpsdRecPoint * ppsdRecPoint ;
ppsdRecPoint = (AliPHOSPpsdRecPoint *) ppsdIn->At(index) ;
if(ppsdRecPoint->GetPHOSMod() != phosmod )
break ;
- if(ppsdRecPoint->GetUp() )
+ if(phosmod <= fGeom->GetNCPVModules()) //in CPV
ppsdOutUp->AddAt(index,inPpsdUp++) ;
- else
- ppsdOutLow->AddAt(index,inPpsdLow++) ;
+ else{ //in PPSD
+ if(ppsdRecPoint->GetUp() )
+ ppsdOutUp->AddAt(index,inPpsdUp++) ;
+ else
+ ppsdOutLow->AddAt(index,inPpsdLow++) ;
+ }
}
ppsdOutLow->Set(inPpsdLow);
ppsdOutUp->Set(inPpsdUp);
ppsdStopedAt = index ;
-}
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv1::FillOneModule(AliPHOSRecPoint::RecPointsList * emcIn,
- TArrayI * emcOut,
- AliPHOSRecPoint::RecPointsList * cpvIn,
- TArrayI * cpvOut,
- Int_t & phosmod,
- Int_t & emcStopedAt,
- Int_t & cpvStopedAt)
-{
- // Fill xxxOut arrays with clusters from one PHOS module EMC+CPV
-
- AliPHOSEmcRecPoint * emcRecPoint ;
- AliPHOSEmcRecPoint * cpvRecPoint ;
- Int_t index ;
-
- Int_t nEmcUnfolded = emcIn->GetEntries() ;
- emcOut->Set(nEmcUnfolded);
- Int_t inEmcOut = 0 ;
- for(index = emcStopedAt; index < nEmcUnfolded; index++){
- emcRecPoint = (AliPHOSEmcRecPoint *) emcIn->At(index) ;
- if(emcRecPoint->GetPHOSMod() != phosmod )
- break ;
-
- emcOut->AddAt(emcRecPoint->GetIndexInList(),inEmcOut) ;
- inEmcOut++ ;
- }
- emcOut->Set(inEmcOut) ;
- emcStopedAt = index ;
-
- cpvOut->Set(cpvIn->GetEntries()) ;
- Int_t inCpvOut = 0;
- for(index = cpvStopedAt; index < cpvIn->GetEntries(); index++){
- cpvRecPoint = (AliPHOSEmcRecPoint *) cpvIn->At(index) ;
- if(cpvRecPoint->GetPHOSMod() != phosmod )
- break ;
- else
- cpvOut->AddAt(index,inCpvOut++) ;
- }
- cpvOut->Set(inCpvOut);
- cpvStopedAt = index ;
-
}
//____________________________________________________________________________
Float_t AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * emcclu,AliPHOSPpsdRecPoint * PpsdClu, Bool_t &toofar)
emcclu->GetLocalPosition(vecEmc) ;
PpsdClu->GetLocalPosition(vecPpsd) ;
if(emcclu->GetPHOSMod() == PpsdClu->GetPHOSMod()){
- if(vecPpsd.X() >= vecEmc.X() - fDelta ){
- if(vecPpsd.Z() >= vecEmc.Z() - fDelta ){
+ // if(vecPpsd.X() >= vecEmc.X() - fDelta ){
+ // if(vecPpsd.Z() >= vecEmc.Z() - fDelta ){
// Correct to difference in CPV and EMC position due to different distance to center.
// we assume, that particle moves from center
Float_t dCPV = fGeom->GetIPtoOuterCoverDistance();
dEMC = dEMC / dCPV ;
vecPpsd = dEMC * vecPpsd - vecEmc ;
r = vecPpsd.Mag() ;
- } // if zPpsd >= zEmc - fDelta
+ // } // if zPpsd >= zEmc - fDelta
toofar = kFALSE ;
- } // if xPpsd >= xEmc - fDelta
- else
- toofar = kTRUE ;
+ //} // if xPpsd >= xEmc - fDelta
+ // else
+ //toofar = kTRUE ;
}
else
toofar = kTRUE ;
+
+ //toofar = kFALSE ;
+
return r ;
}
emc = emcRecPoints->At(linkLow->GetEmc()) ;
ppsdLow = ppsdRecPointsLow->At(linkLow->GetPpsd()) ;
- if( (emc >= 0) && (ppsdLow >= 0) ){ // RecPoints not removed yet
+ if( (emc >= 0) && (ppsdLow >= 0) ){ // RecPoints not removed yet
+
new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment((AliPHOSEmcRecPoint *)fPlease->GimeRecPoint(emc,"emc"),
nullpointer,
(AliPHOSPpsdRecPoint *)fPlease->GimeRecPoint(ppsdLow,"ppsd") ) ;
((AliPHOSTrackSegment* )trsl->At(fNTrackSegments))->SetIndexInList(fNTrackSegments);
//replace index of emc to negative and shifted index of TS
emcRecPoints->AddAt(-2 - fNTrackSegments,linkLow->GetEmc()) ;
- //replace index of emc to negative and shifted index of TS
+ //replace index of PPSD Low to negative and shifted index of TS
ppsdRecPointsLow->AddAt(-2 - fNTrackSegments,linkLow->GetPpsd()) ;
fNTrackSegments++ ;
if(emc != -1){ //without ppsd Up yet
ppsdUp = ppsdRecPointsUp->At(linkUp->GetPpsd()) ;
-
- if(emc >= 0){ //without ppsd Low => create new TS
-
- fNTrackSegments = trsl->GetEntries() ;
- new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment((AliPHOSEmcRecPoint *) fPlease->GimeRecPoint(emc,"emc"),
- (AliPHOSPpsdRecPoint *)fPlease->GimeRecPoint(ppsdUp,"ppsd"),
- nullpointer) ;
- ((AliPHOSTrackSegment *) trsl->At(fNTrackSegments))->SetIndexInList(fNTrackSegments);
- fNTrackSegments++ ;
- }
- else{ // append ppsd Up to existing TS
- ((AliPHOSTrackSegment *)trsl->At(-2-emc))->SetPpsdUpRecPoint((AliPHOSPpsdRecPoint *)fPlease->GimeRecPoint(ppsdUp,"ppsd"));
- }
- emcRecPoints->AddAt(-1,linkUp->GetEmc()) ; //Mark that PPSD Up found
-
+ if(ppsdUp >= 0){ //ppsdUp still exist
+
+ if(emc >= 0){ //without ppsd Low => create new TS
+
+ fNTrackSegments = trsl->GetEntries() ;
+ new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment((AliPHOSEmcRecPoint *) fPlease->GimeRecPoint(emc,"emc"),
+ (AliPHOSPpsdRecPoint *)fPlease->GimeRecPoint(ppsdUp,"ppsd"),
+ nullpointer) ;
+ ((AliPHOSTrackSegment *) trsl->At(fNTrackSegments))->SetIndexInList(fNTrackSegments);
+ fNTrackSegments++ ;
+ }
+ else{ // append ppsd Up to existing TS
+ ((AliPHOSTrackSegment *)trsl->At(-2-emc))->SetPpsdUpRecPoint((AliPHOSPpsdRecPoint *)fPlease->GimeRecPoint(ppsdUp,"ppsd"));
+ }
+
+ emcRecPoints->AddAt(-1,linkUp->GetEmc()) ; //Mark that PPSD Up found
+ //replace index of PPSD Up to negative and shifted index of TS
+ ppsdRecPointsUp->AddAt(-2 - fNTrackSegments,linkUp->GetPpsd()) ;
+ } //if ppsdUp still exist
}
}
{
// Makes the track segments out of the list of EMC and PPSD Recpoints and stores them in a list
- Int_t phosmod = 1 ;
Int_t emcStopedAt = 0 ;
Int_t ppsdStopedAt = 0 ;
fNTrackSegments = 0 ;
-
TArrayI * emcRecPoints = new TArrayI(1000) ; // these arrays keep indexes
TArrayI * ppsdRecPointsUp = new TArrayI(1000) ; // of RecPoints, which are
- TArrayI * ppsdRecPointsLow = new TArrayI(1000) ; // kept in TClonesArray's emcl and ppsdl
+ TArrayI * ppsdRecPointsLow = new TArrayI(1000) ; // kept in TClonesArray's emcl, ppsdl, cpv
-
- TClonesArray * linklowArray = new TClonesArray("AliPHOSLink", 100);
- TClonesArray * linkupArray = new TClonesArray("AliPHOSLink", 100);
-
+ TClonesArray * linklowArray = new TClonesArray("AliPHOSLink", 1000);
+ TClonesArray * linkupArray = new TClonesArray("AliPHOSLink", 1000);
if(fUnfoldFlag){
- UnfoldAll(dl, emcl) ; // Unfolds all EMC clusters
+ UnfoldAll(dl, emcl) ; // Unfolds all EMC clusters
+ UnfoldAll(dl, ppsdl) ; // Unfolds all CPV clusters
}
-
+ Int_t phosmod = 1 ;
while(phosmod <= fGeom->GetNModules() ){
FillOneModule(emcl, emcRecPoints, ppsdl, ppsdRecPointsUp, ppsdRecPointsLow, phosmod, emcStopedAt, ppsdStopedAt) ;
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::MakeTrackSegmentsCPV(DigitsList * dl,
- AliPHOSRecPoint::RecPointsList * emcl,
- AliPHOSRecPoint::RecPointsList * cpvl)
+ AliPHOSRecPoint::RecPointsList * emcl,
+ AliPHOSRecPoint::RecPointsList * cpvl)
{
// Unfold clusters in EMC and CPV and refill reconstructed point lists emcl and ppsdl
// Yuri Kharlov. 19 October 2000
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::UnfoldAll(DigitsList * dl, AliPHOSRecPoint::RecPointsList * emcIn)
{
- // Performs unfolding of all EMC clusters, sorts them and resets indexes in RecPoints
+ // Performs unfolding of all EMC/CPV but NOT ppsd clusters, sorts them and resets indexes in RecPoints
AliPHOSEmcRecPoint * emcRecPoint ;
Int_t index ;
Int_t nEmcUnfolded = emcIn->GetEntries() ;
-
- for(index = 0 ; index < nEmcUnfolded; index++){
- emcRecPoint = (AliPHOSEmcRecPoint *) emcIn->At(index) ;
+ Int_t nModulesToUnfold ;
+
+ if(emcIn->GetEntries() > 0){
+
+ if(((AliPHOSRecPoint *)emcIn->At(0))->IsEmc()){
+ nModulesToUnfold = fGeom->GetNModules() ;
+ }
+ else{
+ nModulesToUnfold = fGeom->GetNCPVModules() ;
+ }
- Int_t nMultipl = emcRecPoint->GetMultiplicity() ;
- Int_t * maxAt = new Int_t[nMultipl] ;
- Float_t * maxAtEnergy = new Float_t[nMultipl] ;
- Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy) ;
+ for(index = 0 ; index < nEmcUnfolded; index++){
+
+ emcRecPoint = (AliPHOSEmcRecPoint *) emcIn->At(index) ;
+ if(emcRecPoint->GetPHOSMod()> nModulesToUnfold)
+ break ;
+
+ Int_t nMultipl = emcRecPoint->GetMultiplicity() ;
+ Int_t * maxAt = new Int_t[nMultipl] ;
+ Float_t * maxAtEnergy = new Float_t[nMultipl] ;
+ Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy) ;
+
+ if( nMax > 1 ) { // if cluster is very flat (no pronounced maximum) then nMax = 0
+ UnfoldClusters(dl, emcIn, emcRecPoint, nMax, maxAt, maxAtEnergy) ;
+ emcIn->Remove(emcRecPoint);
+ emcIn->Compress() ;
+ index-- ;
+ nEmcUnfolded-- ;
+ }
+
+ delete[] maxAt ;
+ delete[] maxAtEnergy ;
+ } //Unfolding finished
+
+ emcIn->Sort() ;
- if( nMax > 1 ) { // if cluster is very flat (no pronounced maximum) then nMax = 0
- UnfoldClusters(dl, emcIn, emcRecPoint, nMax, maxAt, maxAtEnergy) ;
- emcIn->Remove(emcRecPoint);
- emcIn->Compress() ;
- index-- ;
- nEmcUnfolded-- ;
- }
+ // to set index to new and correct index of old RecPoints
+ for( index = 0 ; index < emcIn->GetEntries() ; index++)
+ ((AliPHOSEmcRecPoint *) emcIn->At(index))->SetIndexInList(index) ;
- delete[] maxAt ;
- delete[] maxAtEnergy ;
- } //Unfolding finished
-
- emcIn->Sort() ;
-
- // to set index to new and correct index of old RecPoints
- for( index = 0 ; index < emcIn->GetEntries() ; index++){
- ((AliPHOSEmcRecPoint *) emcIn->At(index))->SetIndexInList(index) ;
}
- emcIn->Sort() ;
-
}
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::UnfoldClusters(DigitsList * dl,
return ;
}
-
Float_t xDigit ;
Float_t zDigit ;
Int_t relid[4] ;
Int_t iDigit ;
AliPHOSDigit * digit ;
- AliPHOSEmcRecPoint * emcRP ;
Int_t * emcDigits = iniEmc->GetDigitsList() ;
Float_t * emcEnergies = iniEmc->GetEnergiesList() ;
if(iRecPoint >= emcIn->GetSize())
emcIn->Expand(2*iRecPoint) ;
- (*emcIn)[iRecPoint] = new AliPHOSEmcRecPoint( iniEmc->GetLogWeightCut(), iniEmc->GetLocMaxCut() ) ;
-
- emcRP = (AliPHOSEmcRecPoint *) emcIn->At(iRecPoint);
- iRecPoint++ ;
- for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
- digit = fPlease->GimeDigit( emcDigits[iDigit] ) ;
- fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
- fGeom->RelPosInModule(relid, xDigit, zDigit) ;
- distance = (xDigit - xpar) * (xDigit - xpar) + (zDigit - zpar) * (zDigit - zpar) ;
- distance = TMath::Sqrt(distance) ;
- ratio = epar * AliPHOSTrackSegmentMakerv1::ShowerShape(distance) / efit[iDigit] ;
- eDigit = emcEnergies[iDigit] * ratio ;
- emcRP->AddDigit( *digit, eDigit ) ;
+ if(iniEmc->IsEmc()){
+ (*emcIn)[iRecPoint] = new AliPHOSEmcRecPoint( iniEmc->GetLogWeightCut(), iniEmc->GetLocMaxCut() ) ;
+
+ AliPHOSEmcRecPoint * emcRP ;
+ emcRP = (AliPHOSEmcRecPoint *) emcIn->At(iRecPoint);
+ iRecPoint++ ;
+
+ for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
+ digit = fPlease->GimeDigit( emcDigits[iDigit] ) ;
+ fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
+ fGeom->RelPosInModule(relid, xDigit, zDigit) ;
+ distance = (xDigit - xpar) * (xDigit - xpar) + (zDigit - zpar) * (zDigit - zpar) ;
+ distance = TMath::Sqrt(distance) ;
+ ratio = epar * AliPHOSTrackSegmentMakerv1::ShowerShape(distance) / efit[iDigit] ;
+ eDigit = emcEnergies[iDigit] * ratio ;
+ emcRP->AddDigit( *digit, eDigit ) ;
+ }
}
+ else{
+ (*emcIn)[iRecPoint] = new AliPHOSCpvRecPoint( iniEmc->GetLogWeightCut(), iniEmc->GetLocMaxCut() ) ;
+
+ AliPHOSCpvRecPoint * cpvRP ;
+ cpvRP = (AliPHOSCpvRecPoint *) emcIn->At(iRecPoint);
+ iRecPoint++ ;
+
+ for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
+ digit = fPlease->GimeDigit( emcDigits[iDigit] ) ;
+ fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
+ fGeom->RelPosInModule(relid, xDigit, zDigit) ;
+ distance = (xDigit - xpar) * (xDigit - xpar) + (zDigit - zpar) * (zDigit - zpar) ;
+ distance = TMath::Sqrt(distance) ;
+ ratio = epar * AliPHOSTrackSegmentMakerv1::ShowerShape(distance) / efit[iDigit] ;
+ eDigit = emcEnergies[iDigit] * ratio ;
+ cpvRP->AddDigit( *digit, eDigit ) ;
+ }
+ }
+
}
delete[] fitparameters ;