* 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"
AliPHOSTrackSegmentMakerv1::~AliPHOSTrackSegmentMakerv1()
{
// dtor
-
- delete gMinuit ;
- gMinuit = 0 ;
}
//____________________________________________________________________________
{
// 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
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);
{
// Makes the track segments out of the list of EMC and PPSD Recpoints and stores them in a list
- Int_t phosmod = fGeom->GetNCPVModules() + 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", 1000);
TClonesArray * linkupArray = new TClonesArray("AliPHOSLink", 1000);
-
if(fUnfoldFlag){
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::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 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
+ Int_t nModulesToUnfold ;
- emcIn->Sort() ;
+ if(emcIn->GetEntries() > 0){
- // to set index to new and correct index of old RecPoints
- for( index = 0 ; index < emcIn->GetEntries() ; index++){
+ if(((AliPHOSRecPoint *)emcIn->At(0))->IsEmc()){
+ nModulesToUnfold = fGeom->GetNModules() ;
+ }
+ else{
+ nModulesToUnfold = fGeom->GetNCPVModules() ;
+ }
- ((AliPHOSEmcRecPoint *) emcIn->At(index))->SetIndexInList(index) ;
+ 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() ;
+
+ // 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,
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 ;