]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/testreconRecParticles.C
Rewriting and cleaning up
[u/mrichter/AliRoot.git] / PHOS / testreconRecParticles.C
index 1c16d8c89ce4b2e4eb3924eed149967c963ae862..fd1cb074fe1236be68c512bf3efa56151405ecbe 100644 (file)
@@ -1,20 +1,39 @@
 #include "AliPHOSPID.h"
 #include "AliPHOSGetter.h"
+#include "AliPHOSPIDv1.h"
+#include "TSystem.h"
 
 void testreconRecParticles(Int_t nevent = 1, const char *config="testconfig.C")
 
-{
+{ 
 
-AliPHOSGetter * gime = AliPHOSGetter::GetInstance("galice.root") ;
- AliPHOSPID * pid = new AliPHOSPIDv1("galice.root","test suite");
- pid->ExecuteTask("deb");
- //cout << "# of trackSegments " << gime->trackSegments()<<GetEntries()<< endl;
- cerr<<"_____________________________________________________________________"<<endl;
- cerr<<" "<<endl;
- cerr<<"      MESS ==> reconstruction ended successfully."<<endl;
- cerr<<"_____________________________________________________________________"<<endl;
+  const Float_t maxRecParticles = 1 ;
+  const Float_t widRecParticles = TMath::Sqrt(maxRecParticles) ;
+  TString name = "test suite" ;
 
 
+  AliPHOSPID * pid = new AliPHOSPIDv1("galice.root",name.Data());
+  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+  pid->ExecuteTask("deb");
+  TString fullName = name + pid->Version() ;  
+   
+  Float_t nRecParticles =  (Float_t) (gime->PID(fullName.Data())->GetRecParticlesInRun())/gime->MaxEvent();
+  cerr<<"_____________________________________________________________________"<<endl;
+  cerr<<" "<<endl;
+  cerr<<"nRecParticles vaut "<<nRecParticles<<endl;
+  cerr<<"_____________________________________________________________________"<<endl;
+  cerr<<"_____________________________________________________________________"<<endl;
+  cerr<<" "<<endl;
+  cerr<<"      MESS ==> reconstruction ended successfully."<<endl;
+  cerr<<"_____________________________________________________________________"<<endl;
+ if ( nRecParticles < maxRecParticles-0.15 || nRecParticles > maxRecParticles+0.15 ) {
+    cerr<<"__________________________________________________________________"<<endl;
+    cerr<<" "<<endl;
+    cerr<<"       MESS ==> Error detected in the RecParticles process. Sending error file to PHOS director."<<endl;
+    cerr<<"__________________________________________________________________"<<endl;
+   // gSystem->Exec("uuencode $ALICE_ROOT/PHOS/galice.root galice.root | mail -s "PHOS INSTALLATION ERROR" schutz@in2p3.fr");
+  }
+
 
 
 }