// --- ROOT system ---
class TFile;
-#include "TTree.h"
-#include "TTask.h"
#include "TROOT.h"
-#include "TFolder.h"
+#include "TTree.h"
+#include "TFolder.h"
// --- Standard library ---
#include "AliRun.h"
#include "AliMagF.h"
#include "AliPHOSGeometry.h"
+#include "AliPHOSQAChecker.h"
ClassImp(AliPHOS)
-
-
//____________________________________________________________________________
- AliPHOS::AliPHOS():AliDetector()
+AliPHOS:: AliPHOS(const char* name, const char* title=""): AliDetector(name, title)
{
- // ctor. creates task PHOS
- TTask * phosTask = new TTask("PHOS","");
- TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
- roottasks->Add(phosTask) ;
-}
+ // create the ALICE TFolder
+ // create the ALICE TTasks
+ // add the Alice QA TTAsks
+ // create the ALICE main TFolder
+ // add the Alice QA Alarms
+ // this should be done of course by AliRun
+
+ TFolder * alice = new TFolder();
+ alice->SetNameTitle("YSAlice", "Alice Folder") ;
+ gROOT->GetListOfBrowsables()->Add(alice) ;
+
+ TFolder * aliceF = alice->AddFolder("folders", "Alice memory Folder") ;
+ // make it the owner of the objects that it contains
+ aliceF->SetOwner() ;
+ TFolder * alarmsF = aliceF->AddFolder("QAAlarms", "Alarms raised by QA check") ;
+ // make it the owner of the objects that it contains
+ alarmsF->SetOwner() ;
+ TFolder * aliceT = alice->AddFolder("tasks", "Alice tasks Folder") ;
+ // make it the owner of the objects that it contains
+ aliceT->SetOwner() ;
+
+ TTask * aliceQA = new TTask("QA", "Alice QA tasks") ;
+ aliceT->Add(aliceQA);
+
+ TTask * aliceDi = new TTask("(S)Digitizer", "Alice SDigitizer & Digitizer") ;
+ aliceT->Add(aliceDi);
+
+ TTask * aliceRe = new TTask("Reconstructioner", "Alice Reconstructioner") ;
+ aliceT->Add(aliceRe);
+
+ char * tempo = new char[80] ;
+
+ // creates the PHOSQA and adds it to alice main QA task
+ sprintf(tempo, "%sCheckers container",GetName() ) ;
+ fQATask = new AliPHOSQAChecker(GetName(), tempo);
+ aliceQA->Add(fQATask) ;
+ // creates the PHOS(S)Digitizer and adds it to alice main (S)Digitizer task
+ sprintf(tempo, "%sDigitizers container",GetName() ) ;
+ fSDTask = new AliPHOSQAChecker(GetName(), tempo);
+ aliceDi->Add(fSDTask) ;
+ // creates the PHOS reconstructioner and adds it to alice main Reconstructioner task
+ sprintf(tempo, "%sReconstructioner container",GetName() ) ;
+ fReTask = new AliPHOSQAChecker(GetName(), tempo);
+ aliceRe->Add(fReTask) ;
+
+ delete tempo ;
+
+ // creates the PHOSQA alarm folder
+ alarmsF->AddFolder("PHOS", "QA alarms from PHOS") ;
+}
//____________________________________________________________________________
- AliPHOS::AliPHOS(const char* name, const char* title=""):AliDetector(name, title)
-{
- // ctor. creates task PHOS
- TTask * phosTask = new TTask("PHOS","");
- TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ;
- roottasks->Add(phosTask) ;
+AliPHOS::~AliPHOS()
+{
+ // remove the alice folder and alice QA task that PHOS creates instead of AliRun
+
+ // remove and delete the PHOS QA tasks
+ TFolder * alice = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("YSAlice") ;
+ TTask * aliceQA = (TTask*)alice->FindObject("tasks/QA") ;
+ fQATask->GetListOfTasks()->Delete() ;
+ aliceQA->GetListOfTasks()->Remove(fQATask) ;
+ delete fQATask ;
+
+ // remove and delete aliceQA (should be done by AliRun)
}
//____________________________________________________________________________
// The Silicon of the pin diode to read out the calorimeter crystal -> idtmed[705]
AliMedium(6, "Si PIN $", 6, 0,
- isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.01, 0.00001, 0, 0) ;
+ isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.01, 0.01, 0, 0) ;
// The thermo insulating material of the box which contains the calorimeter module -> idtmed[706]
AliMedium(7, "Thermo Insul.$", 7, 0,
gMC->Gstpar(idtmed[701], "LOSS",3.) ;
gMC->Gstpar(idtmed[701], "DRAY",1.) ;
// --- and in PIN diode
- //setting local cuts to 10 keV OHO 20.04.2001
gMC->Gstpar(idtmed[705], "LOSS",3) ;
gMC->Gstpar(idtmed[705], "DRAY",1) ;
- gMC->Gstpar(idtmed[705], "STRA",1.);
- gMC->Gstpar(idtmed[705], "CUTGAM",1.E-5) ;
- gMC->Gstpar(idtmed[705], "CUTELE",1.E-5) ;
- gMC->Gstpar(idtmed[705], "CUTNEU",1.E-5) ;
- gMC->Gstpar(idtmed[705], "CUTHAD",1.E-5) ;
- gMC->Gstpar(idtmed[705], "CUTMUO",1.E-5) ;
- gMC->Gstpar(idtmed[705], "BCUTE",1.E-5) ;
- gMC->Gstpar(idtmed[705], "BCUTM",1.E-5) ;
- gMC->Gstpar(idtmed[705], "DCUTE",1.E-5) ;
- gMC->Gstpar(idtmed[705], "DCUTM",1.E-5) ;
- gMC->Gstpar(idtmed[705], "PPCUTM",1.E-5) ;
- //
// --- and in the passive convertor
gMC->Gstpar(idtmed[712], "LOSS",3) ;
gMC->Gstpar(idtmed[712], "DRAY",1) ;
//____________________________________________________________________________
void AliPHOS::SetTreeAddress()
{
- // called by AliRun
+
+
// TBranch *branch;
// AliDetector::SetTreeAddress();
//_________________________________________________________________________
// Base Class for PHOS
-// PHOS consists of a PbWO4 calorimeter (EMCA) and a gazeous charged
-// particles detector (CPV or PPSD).
-// The only provided method here is CreateMaterials,
-// which defines the materials common to all PHOS versions.
//
//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
// --- ROOT system ---
class TString ;
+class TTask ;
// --- AliRoot header files ---
#include "AliDetector.h"
class AliPHOSGeometry ;
+class AliPHOSQAChecker ;
class AliPHOS : public AliDetector {
public:
- AliPHOS();
- AliPHOS(const char* name, const char* title="");
+ AliPHOS() : AliDetector() {fQATask=0;}
+ AliPHOS(const char* name, const char* title="") ;
AliPHOS(const AliPHOS & phos) {
// cpy ctor: no implementation yet
// requested by the Coding Convention
abort() ;
}
- virtual ~AliPHOS() {}
+ virtual ~AliPHOS() ;
virtual void AddHit(Int_t, Int_t*, Float_t *) {
// do not use this definition but the one below
abort() ;
virtual void AddHit( Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits ) = 0 ;
virtual void CreateMaterials() ;
virtual AliPHOSGeometry * GetGeometry() const = 0 ;
-
Int_t IsVersion(void) const { return -1 ; }
+ AliPHOSQAChecker * QAChecker() {return fQATask;}
virtual void SetTreeAddress();
virtual TString Version() {return TString(" ") ; }
AliPHOS & operator = (const AliPHOS & rvalue) {
- // assignement operator requested by coding convention but not needed
+ // assignement operator requested by coding convention
+ // but not needed
abort() ;
return *this ;
}
protected:
+
+ AliPHOSQAChecker * fQATask ; // PHOS checkers container
+ TTask * fSDTask ; // PHOS (S)Digitizer container
+ TTask * fReTask ; // PHOS Reconstructioner container
ClassDef(AliPHOS,2) // Photon Spectrometer Detector (base class)
#include "AliConst.h"
#include "AliMC.h"
#include "AliPHOSGeometry.h"
+#include "AliPHOSQAIntCheckable.h"
+#include "AliPHOSQAFloatCheckable.h"
+#include "AliPHOSQAMeanChecker.h"
ClassImp(AliPHOSv1)
AliPHOSv0()
{
// ctor
+
}
//____________________________________________________________________________
AliPHOSv1::AliPHOSv1(const char *name, const char *title):
-AliPHOSv0(name,title)
+ AliPHOSv0(name,title)
{
// ctor : title is used to identify the layout
// GPS2 = 5 modules (EMC + PPSD)
// We do not want to save in TreeH the raw hits
// But save the cumulated hits instead (need to create the branch myself)
// It is put in the Digit Tree because the TreeH is filled after each primary
- // and the TreeD at the end of the event (branch is set in FinishEvent() ).
+ // and the TreeD at the end of the event (branch is set in FinishEvent() ).
fHits= new TClonesArray("AliPHOSHit",1000) ;
fNhits = 0 ;
fIshunt = 1 ; // All hits are associated with primary particles
+
+ Int_t nb = fGeom->GetNModules() ;
+ // create checkables
+ fQAHitsMul = new AliPHOSQAIntCheckable("HitsM") ;
+ fQATotEner = new AliPHOSQAFloatCheckable("TotEn") ;
+ fQAHitsMulB = new TClonesArray("AliPHOSQAIntCheckable",nb) ;
+ fQATotEnerB = new TClonesArray("AliPHOSQAFloatCheckable", nb);
+ char tempo[20] ;
+ Int_t i ;
+ for ( i = 0 ; i < nb ; i++ ) {
+ sprintf(tempo, "HitsMB%d", i+1) ;
+ new( (*fQAHitsMulB)[i]) AliPHOSQAIntCheckable(tempo) ;
+ sprintf(tempo, "TotEnB%d", i+1) ;
+ new( (*fQATotEnerB)[i] ) AliPHOSQAFloatCheckable(tempo) ;
+ }
+
+ // create checkers
+ // the container (QAChecker()) owns and deletes this local checker (see Hara-Kiri)
+ // the local checker can be accessed by
+ // AliPHOSQAChecker * phos =
+ // (AliPHOSQAChecker*)(gROOT->GetListOfBrowsables()->FindObject("YSALICE")->FindObject("tasks/QA/PHOS"))
+ // AliPHOSQAMeanChecker * ch = (AliPHOSQAMeanChecker*)(phos->FindObject("QAHitsMul"))
+ // or directly from the root/Tasks folder
+
+ AliPHOSQAMeanChecker * hmc = new AliPHOSQAMeanChecker("HitsMul", 100. ,25.) ;
+ AliPHOSQAMeanChecker * emc = new AliPHOSQAMeanChecker("TotEner", 10. ,5.) ;
+ AliPHOSQAMeanChecker * bhmc = new AliPHOSQAMeanChecker("HitsMulB", 100. ,5.) ;
+ AliPHOSQAMeanChecker * bemc = new AliPHOSQAMeanChecker("TotEnerB", 2. ,.5) ;
+
+ // associate checkables and checkers
+ fQAHitsMul->AddChecker(hmc) ;
+ fQATotEner->AddChecker(emc) ;
+ for ( i = 0 ; i < nb ; i++ ) {
+ ((AliPHOSQAIntCheckable*)(*fQAHitsMulB)[i])->AddChecker(bhmc) ;
+ ((AliPHOSQAFloatCheckable*)(*fQATotEnerB)[i])->AddChecker(bemc) ;
+ }
}
//____________________________________________________________________________
if ( !deja ) {
new((*fHits)[fNhits]) AliPHOSHit(*newHit) ;
+ // get the block Id number
+ Int_t * relid = new Int_t[fGeom->GetNModules()] ;
+ fGeom->AbsToRelNumbering(Id, relid) ;
+ // and fill the relevant QA checkable (only if in PbW04)
+ if ( relid[1] == 0 ) {
+ fQAHitsMul->Update(1) ;
+ ((AliPHOSQAIntCheckable*)(*fQAHitsMulB)[relid[0]-1])->Update(1) ;
+ }
+ delete relid ;
fNhits++ ;
}
delete newHit;
}
+//____________________________________________________________________________
+void AliPHOSv1::FinishPrimary()
+{
+ // called at the end of each track (primary) by AliRun
+ // hits are reset for each new track
+ // accumulate the total hit-multiplicity
+// if ( fQAHitsMul )
+// fQAHitsMul->Update( fHits->GetEntriesFast() ) ;
+
+}
+
+//____________________________________________________________________________
+void AliPHOSv1::FinishEvent()
+{
+ // called at the end of each event by AliRun
+ // accumulate the hit-multiplicity and total energy per block
+ // if the values have been updated check it
+
+ if ( fQATotEner ) {
+ if ( fQATotEner->HasChanged() ) {
+ fQATotEner->CheckMe() ;
+ fQATotEner->Reset() ;
+ }
+ }
+
+ Int_t i ;
+ if ( fQAHitsMulB && fQATotEnerB ) {
+ for (i = 0 ; i < fGeom->GetNModules() ; i++) {
+ AliPHOSQAIntCheckable * ci = (AliPHOSQAIntCheckable*)(*fQAHitsMulB)[i] ;
+ AliPHOSQAFloatCheckable* cf = (AliPHOSQAFloatCheckable*)(*fQATotEnerB)[i] ;
+ if ( ci->HasChanged() ) {
+ ci->CheckMe() ;
+ ci->Reset() ;
+ }
+ if ( cf->HasChanged() ) {
+ cf->CheckMe() ;
+ cf->Reset() ;
+ }
+ }
+ }
+
+ // check the total multiplicity
+
+ if ( fQAHitsMul ) {
+ if ( fQAHitsMul->HasChanged() ) {
+ fQAHitsMul->CheckMe() ;
+ fQAHitsMul->Reset() ;
+ }
+ }
+}
+
//____________________________________________________________________________
void AliPHOSv1::StepManager(void)
{
if ( xyze[3] != 0 ) { // Track is inside the crystal and deposits some energy
gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module number ;
+
+ // fill the relevant QA Checkables
+ fQATotEner->Update( xyze[3] ) ; // total energy in PHOS
+ ((AliPHOSQAFloatCheckable*)(*fQATotEnerB)[relid[0]-1])->Update( xyze[3] ) ; // energy in this block
if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(10),"PHO1") == 0 )
relid[0] += fGeom->GetNModules() - fGeom->GetNPPSDModules();
Float_t pNorm = p.Py();
Float_t eloss = kdEdx;
+// cout << "CPVDigitize: YVK : "<<hitX<<" "<<hitZ<<" | "<<pX<<" "<<pZ<<" "<<pNorm<<endl;
+
Float_t dZY = pZ/pNorm * fGeom->GetCPVGasThickness();
Float_t dXY = pX/pNorm * fGeom->GetCPVGasThickness();
gRandom->Rannor(rnor1,rnor2);
// --- AliRoot header files ---
#include "AliPHOSv0.h"
+class AliPHOSQAIntCheckable ;
+class AliPHOSQAFloatCheckable ;
class AliPHOSv1 : public AliPHOSv0 {
}
virtual ~AliPHOSv1(void) ;
- virtual void AddHit( Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits);
- virtual Int_t IsVersion(void) const {
+ virtual void AddHit( Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits) ;
+ virtual void FinishEvent() ;
+ virtual void FinishPrimary() ;
+ virtual Int_t IsVersion(void) const {
// Gives the version number
return 1 ;
}
protected:
+
+ AliPHOSQAIntCheckable * fQAHitsMul ; // QA Hits Multiplicity checkable
+ TClonesArray * fQAHitsMulB ; // QA Hits Multiplicity / Block checkable
+ AliPHOSQAFloatCheckable * fQATotEner ; // QA Total Energy checkable
+ TClonesArray * fQATotEnerB ; // QA Total Energy / Block checkable
ClassDef(AliPHOSv1,1) // Implementation of PHOS manager class for layout EMC+PPSD
AliPHOSRecParticle.cxx AliPHOSPID.cxx AliPHOSPIDv1.cxx \
AliPHOSAnalyze.cxx AliPHOSFastRecParticle.cxx \
AliPHOSIndexToObject.cxx \
- AliDBPPR.cxx AliDBPPRS.cxx
+ AliPHOSQAVirtualCheckable.cxx AliPHOSQAIntCheckable.cxx AliPHOSQAFloatCheckable.cxx\
+ AliPHOSQAObjectCheckable.cxx AliPHOSQAChecker.cxx AliPHOSQAMeanChecker.cxx AliPHOSQAAlarm.cxx
# C++ Headers
#pragma link C++ class AliPHOSIndexToObject+;
#pragma link C++ class AliPHOSAnalyze+;
#pragma link C++ class AliPHOSCPVDigit+;
-#pragma link C++ class AliDBPPR+;
-#pragma link C++ class AliDBPPRS+;
-
+#pragma link C++ class AliPHOSQAVirtualCheckable+;
+#pragma link C++ class AliPHOSQAIntCheckable+;
+#pragma link C++ class AliPHOSQAFloatCheckable+;
+#pragma link C++ class AliPHOSQAObjectCheckable+;
+#pragma link C++ class AliPHOSQAChecker+;
+#pragma link C++ class AliPHOSQAMeanChecker+;
+#pragma link C++ class AliPHOSQAAlarm+;
#endif