fFileNamePar = "" ;
fFrom = "" ;
fHeaderFileName = "" ;
+ fOptFileName = "Default" ;
fTrackSegmentsTitle = "" ;
fRecPointsTitle = "" ;
fRecParticlesTitle = "" ;
//____________________________________________________________________________
AliPHOSPIDv1::AliPHOSPIDv1(const char * headerFile,const char * name, const char * from) : AliPHOSPID(headerFile, name)
+
+
{
//ctor with the indication on where to look for the track segments
fFrom = name ;
else
fFrom = from ;
+ fOptFileName = "Default" ;
Init() ;
}
SetTitle("galice.root") ;
SetParameters() ; // fill the parameters matrix from parameters file
-
+
AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), fFrom.Data()) ;
gime->SetRecParticlesTitle(BranchName()) ;
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
+
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
}
}
//____________________________________________________________________________
- void AliPHOSPIDv1::SetEllipseParameters(Float_t Cluster_En, TString Eff_Pur, Float_t x, Float_t y,Float_t a, Float_t b,Float_t angle)
+void AliPHOSPIDv1::SetPrincipalFileOptions(TString OptFileName) {
+
+ if(OptFileName.Contains("Small energy range")||OptFileName.Contains("Default")){
+ fFileName = "$ALICE_ROOT/PHOS/PCA8pa15_0.5-5.root" ;
+ fFileNamePar = gSystem->ExpandPathName("$ALICE_ROOT/PHOS/Parameters_0.5_5.dat");
+ }
+
+ if(OptFileName.Contains("Wide energy range")){
+ fFileName = "$ALICE_ROOT/PHOS/PCA8pa15_0.5-100.root" ;
+ fFileNamePar = gSystem->ExpandPathName("$ALICE_ROOT/PHOS/Parameters_0.5_100.dat");
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSPIDv1::SetEllipseParameters(Float_t Cluster_En, TString Eff_Pur, Float_t x, Float_t y,Float_t a, Float_t b,Float_t angle)
{
// Set all ellipse parameters depending on the cluster energy and
Int_t cluster = -1 ;
Int_t eff_pur = -1 ;
-
- if((Cluster_En > 0.3)&&(Cluster_En <= 1.0)) cluster = 0 ;
- if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
- if( Cluster_En > 2.0) cluster= 2 ;
-
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
-
- if(cluster ==-1){
+
+ if((Cluster_En > 0.3)&&(Cluster_En <= 1.0)) cluster = 0 ;
+ if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
+ if( Cluster_En > 2.0) cluster= 2 ;
+
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
+
+ if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
}
else if(eff_pur ==-1){
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
Int_t cluster = -1 ;
Int_t eff_pur = -1 ;
-
+
if((Cluster_En > 0.3)&&(Cluster_En <= 1.0)) cluster = 0 ;
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
-
- if(cluster ==-1){
- cout<<"Invalid Cluster Energy option"<<endl;
- }
- else if(eff_pur ==-1){
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
+
+ if(cluster ==-1){
+ cout<<"Invalid Cluster Energy option"<<endl;
+ }
+ else if(eff_pur ==-1){
cout<<"Invalid Efficiency-Purity option"<<endl;
- }
- else{
- (*fParameters)(cluster+15,eff_pur) = b ;
- }
+ }
+ else{
+ (*fParameters)(cluster+15,eff_pur) = b ;
+ }
}
//________________________________________________________________________
void AliPHOSPIDv1::SetEllipseAngle(Float_t Cluster_En, TString Eff_Pur, Float_t angle)
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
-
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
+
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
}
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
-
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
+
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
}
// the Principal file, which is opened here
fX = new double[7]; // Data for the PCA
fP = new double[7]; // Eigenvalues of the PCA
- if (fFileName.IsNull())
- fFileName = "$ALICE_ROOT/PHOS/PCA8pa15_0.5-100.root" ;
+
+ SetPrincipalFileOptions(fOptFileName);
TFile f( fFileName.Data(), "read" ) ;
fPrincipal = dynamic_cast<TPrincipal*> (f.Get("principal")) ;
f.Close() ;
fParameters = new TMatrixD(21,3) ;
- if (fFileNamePar.IsNull())
- fFileNamePar = gSystem->ExpandPathName("$ALICE_ROOT/PHOS/Parameters.dat");
ifstream paramFile(fFileNamePar, ios::in) ;
Int_t i,j ;
if((Cluster_En > 1.0)&&(Cluster_En <= 2.0)) cluster = 1 ;
if( Cluster_En > 2.0) cluster = 2 ;
- if(strstr( Eff_Pur,"HIGH EFFICIENCY" )||strstr( Eff_Pur,"LOW PURITY" ) ) eff_pur = 0 ;
- if(strstr( Eff_Pur,"MEDIUM EFFICIENCY" )||strstr( Eff_Pur,"MEDIUM PURITY" ) ) eff_pur = 1 ;
- if(strstr( Eff_Pur,"LOW EFFICIENCY" )||strstr( Eff_Pur,"HIGH PURITY" ) ) eff_pur = 2 ;
+ if(Eff_Pur.Contains("HIGH EFFICIENCY") ||Eff_Pur.Contains("LOW PURITY") ) eff_pur = 0 ;
+ if(Eff_Pur.Contains("MEDIUM EFFICIENCY") ||Eff_Pur.Contains("MEDIUM PURITY") ) eff_pur = 1 ;
+ if(Eff_Pur.Contains("LOW EFFICIENCY")||Eff_Pur.Contains("HIGH PURITY") ) eff_pur = 2 ;
if(cluster ==-1){
cout<<"Invalid Cluster Energy option"<<endl;
rp->SetPIDBit(eff_pur+6) ;
}
+
+ rp->Name(); //If photon sets the particle pdg name to gamma
rp->SetProductionVertex(0,0,0,0);
rp->SetFirstMother(-1);
rp->SetLastMother(-1);
cout << " RecPoints branch title: " << fRecPointsTitle.Data() << endl ;
cout << " TrackSegments Branch title: " << fTrackSegmentsTitle.Data() << endl ;
cout << " RecParticles Branch title " << fRecParticlesTitle.Data() << endl;
- cout << "with parameters: " << endl ;
- SetParameters() ;
+ cout << " Matrix of Parameters: "<<endl;
+ cout << " 3 Columns [High Eff-Low Pur,Medium Eff-Pur, Low Eff-High Pur]"<<endl;
+ cout << " 21 Rows, each 3 [ RCPV, TOF, X_Center, Y_Center, A, B, Angle ]"<<endl;
+ SetParameters() ;
fParameters->Print() ;
cout << "============================================" << endl ;
}
if(strstr(option,"all")) { // printing found TS
- cout << " PARTICLE "
+ cout << " PARTICLE "
<< " Index " << endl ;
Int_t index ;
for (index = 0 ; index < recParticles->GetEntries() ; index++) {
AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) recParticles->At(index) ;
- //cout<<" Type " <<rp->GetType()<<endl;
- //Text_t particle[11];
- // switch(rp->GetType()) {
-// case AliPHOSFastRecParticle::kCHARGEDHASLOW:
-// strcpy(particle, "CHARGED HA SLOW") ;
-// break ;
-// case AliPHOSFastRecParticle::kNEUTRALHASLOW:
-// strcpy(particle, "NEUTRAL HA SLOW");
-// break ;
-// case AliPHOSFastRecParticle::kCHARGEDHAFAST:
-// strcpy(particle, "CHARGED HA FAST") ;
-// break ;
-// case AliPHOSFastRecParticle::kNEUTRALHAFAST:
-// strcpy(particle, "NEUTRAL HA FAST");
-// break;
-// case AliPHOSFastRecParticle::kCHARGEDEMSLOW:
-// strcpy(particle, "CHARGED EM SLOW") ;
-// break ;
-// case AliPHOSFastRecParticle::kNEUTRALEMSLOW:
-// strcpy(particle, "NEUTRAL EM SLOW");
-// break ;
-// case AliPHOSFastRecParticle::kCHARGEDEMFAST:
-// strcpy(particle, "CHARGED EM FAST") ;
-// break ;
-// case AliPHOSFastRecParticle::kNEUTRALEMFAST:
-// strcpy( particle, "NEUTRAL EM FAST");
-// break;
-// }
-
- cout << setw(10) << rp->GetType() << " "
- << setw(5) << rp->GetIndexInList() << " " <<endl;
-
+
+ cout << setw(10) << rp->Name() << " "
+ << setw(5) << rp->GetIndexInList() << " " <<endl;
+ cout << "Type "<< rp->GetType() << endl;
}
cout << "-------------------------------------------" << endl ;
}