/* History of cvs commits:
*
* $Log$
+ * Revision 1.113 2007/07/18 16:29:54 policheh
+ * Raw Sdigits energy converted to GeV.
+ *
* Revision 1.112 2007/02/25 22:59:13 policheh
* Digits2Raw(): ALTRO buffer and mapping created per each DDL.
*
*
* Revision 1.105 2007/01/12 21:44:29 kharlov
* Simulate and reconstruct two gains simulaneouslsy
- *
- * Revision 1.104 2006/11/23 13:40:44 hristov
- * Common class for raw data reading and ALTRO mappiing for PHOS and EMCAL (Gustavo, Cvetan)
- *
- * Revision 1.103 2006/11/14 17:11:15 hristov
- * Removing inheritances from TAttLine, TAttMarker and AliRndm in AliModule. The copy constructor and assignment operators are moved to the private part of the class and not implemented. The corresponding changes are propagated to the detectors
- *
- * Revision 1.102 2006/10/27 17:14:27 kharlov
- * Introduce AliDebug and AliLog (B.Polichtchouk)
- *
- * Revision 1.101 2006/10/13 06:47:29 kharlov
- * Simulation of RAW data applies real mapping (B.Polichtchouk)
- *
- * Revision 1.100 2006/08/11 12:36:26 cvetan
- * Update of the PHOS code needed in order to read and reconstruct the beam test raw data (i.e. without an existing galice.root)
- *
- * Revision 1.99 2006/06/28 11:36:09 cvetan
- * New detector numbering scheme (common for DAQ/HLT/Offline). All the subdetectors shall use the AliDAQ class for the sim and rec of the raw data. The AliDAQ and raw reader classes now provide all the necessary interfaces to write and select the detector specific raw-data payload. Look into the AliDAQ.h and AliRawReader.h for more details.
- *
- * Revision 1.98 2006/05/11 11:30:48 cvetan
- * Major changes in AliAltroBuffer. Now it can be used only for writing of raw data. All the corresponding read method are removed. It is based now on AliFstream in order to avoid endianess problems. The altro raw data is written always with little endian
- *
- * Revision 1.97 2006/04/22 10:30:17 hristov
- * Add fEnergy to AliPHOSDigit and operate with EMC amplitude in energy units (Yu.Kharlov)
- *
- * Revision 1.96 2006/04/07 08:41:59 hristov
- * Follow AliAlignObj framework and remove AliPHOSAlignData (Yu.Kharlov)
- *
- * Revision 1.95 2006/03/14 19:40:41 kharlov
- * Remove De-digitizing of raw data and digitizing the raw data fit
- *
- * Revision 1.94 2006/03/07 18:56:25 kharlov
- * CDB is passed via environment variable
- *
- * Revision 1.93 2005/11/22 08:45:11 kharlov
- * Calibration is read from CDB if any (Boris Polichtchouk)
- *
- * Revision 1.92 2005/11/03 13:09:19 hristov
- * Removing meaningless const declarations (linuxicc)
- *
- * Revision 1.91 2005/07/27 15:08:53 kharlov
- * Mixture ArCO2 is corrected
- *
- * Revision 1.90 2005/06/17 07:39:07 hristov
- * Removing GetDebug and SetDebug from AliRun and AliModule. Using AliLog for the messages
- *
- * Revision 1.89 2005/05/28 12:10:07 schutz
- * Copy constructor is corrected (by T.P.)
- *
*/
//_________________________________________________________________________
#include "AliDAQ.h"
#include "AliPHOSRawDecoder.h"
#include "AliPHOSRawDigiProducer.h"
+#include "AliPHOSQualAssChecker.h"
ClassImp(AliPHOS)
return kTRUE;
}
+
+//____________________________________________________________________________
+void AliPHOS::CheckQA()
+{
+ // check the Quality Assurance data
+
+ AliPHOSQualAssChecker phosQA ;
+ phosQA.Exec() ;
+}
/* History of cvs commits:
*
* $Log$
+ * Revision 1.72 2007/02/13 10:52:08 policheh
+ * Raw2SDigits() implemented
+ *
* Revision 1.71 2007/02/05 10:43:25 hristov
* Changes for correct initialization of Geant4 (Mihaela)
*
virtual void SetTreeAddress();
virtual const TString Version() const {return TString(" ") ; }
+ //QA methods
+ virtual void CheckQA() ;
+
private:
AliPHOS(AliPHOS & phos);
AliPHOS & operator = (const AliPHOS & /*rvalue*/);
/* History of cvs commits:
*
* $Log$
+ * Revision 1.40 2006/08/25 16:56:30 kharlov
+ * Compliance with Effective C++
+ *
* Revision 1.39 2006/03/30 13:04:56 hristov
* AliRawReader is not persistent
*
//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
// --- ROOT system ---
-#include "TTask.h"
-#include "AliConfig.h"
-#include "AliRawReaderFile.h"
+#include "TTask.h"
class TFile ;
// --- Standard library ---
// --- AliRoot header files ---
+#include "AliConfig.h"
+#include "AliRawReaderFile.h"
+class AliPHOSQualAssDataMaker ;
class AliPHOSClusterizer : public TTask {
virtual const char * Version() const {Warning("Version", "Not Defined" ) ; return 0 ; }
protected:
+ AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; }
+
TString fEventFolderName ; // event folder name
Int_t fFirstEvent; // first event to process
Int_t fLastEvent; // last event to process
AliRawReader *fRawReader; //! reader of raw data
+ AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
+
ClassDef(AliPHOSClusterizer,4) // Clusterization algorithm class
} ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.109 2007/07/24 17:20:35 policheh
+ * Usage of RecoParam objects instead of hardcoded parameters in reconstruction.
+ * (See $ALICE_ROOT/PHOS/macros/BeamTest2006/RawReconstruction.C).
+ *
* Revision 1.108 2007/06/18 07:00:51 kharlov
* Bug fix for attempt to use AliPHOSEmcRecPoint after its deletion
*
#include "AliCDBEntry.h"
#include "AliPHOSReconstructor.h"
#include "AliPHOSRecoParam.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp(AliPHOSClusterizerv1)
fCpvClusteringThreshold(0), fEmcMinE(0), fCpvMinE(0),
fEmcLocMaxCut(0), fW0(0), fCpvLocMaxCut(0),
fW0CPV(0), fRecPointsInRun(0), fEmcTimeGate(0),
- fIsOldRCUFormat(0)
+ fIsOldRCUFormat(0), fEventCounter(0)
{
// default ctor (to be used mainly by Streamer)
fCpvClusteringThreshold(0), fEmcMinE(0), fCpvMinE(0),
fEmcLocMaxCut(0), fW0(0), fCpvLocMaxCut(0),
fW0CPV(0), fRecPointsInRun(0), fEmcTimeGate(0),
- fIsOldRCUFormat(0)
+ fIsOldRCUFormat(0), fEventCounter(0)
{
// ctor with the indication of the file where header Tree and digits Tree are stored
fCpvClusteringThreshold(0), fEmcMinE(0), fCpvMinE(0),
fEmcLocMaxCut(0), fW0(0), fCpvLocMaxCut(0),
fW0CPV(0), fRecPointsInRun(0), fEmcTimeGate(0),
- fIsOldRCUFormat(0)
+ fIsOldRCUFormat(0), fEventCounter(0)
{
// Copy constructor
}
Int_t ievent ;
for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
+ fEventCounter++ ;
if (fRawReader == 0)
gime->Event(ievent ,"D"); // Read digits from simulated data
else {
if(fToUnfold)
MakeUnfolding() ;
-
+
+ //makes the quality assurance data
+ GetQualAssDataMaker()->SetData(gime->EmcRecPoints()) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ;
+ GetQualAssDataMaker()->SetData(gime->CpvRecPoints()) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ;
+
WriteRecPoints();
if(strstr(option,"deb"))
fRecPointsInRun += gime->CpvRecPoints()->GetEntriesFast() ;
}
- if(fWrite) //do not unload in "on flight" mode
+ //Write the quality assurance data only after the last event
+ if ( fEventCounter == gime->MaxEvent())
+ GetQualAssDataMaker()->Finish(AliQualAss::kRECPOINTS) ;
+
+ if(fWrite) //do not unload in "on flight" mode
Unload();
if(strstr(option,"tim")){
/* History of cvs commits:
*
* $Log$
+ * Revision 1.51 2007/04/11 11:55:45 policheh
+ * SetDistancesToBadChannels() added.
+ *
* Revision 1.50 2007/03/28 19:18:15 kharlov
* RecPoints recalculation in TSM removed
*
Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
Bool_t fIsOldRCUFormat; // assume old RCU raw data format
+ Int_t fEventCounter ; //! counts the events processed
ClassDef(AliPHOSClusterizerv1,4) // Clusterizer implementation version 1
#include "AliPHOSRecCpvManager.h"
#include "AliPHOSRecEmcManager.h"
#include "AliPHOSGeometry.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp(AliPHOSClusterizerv2)
gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(),
nOldEmc,
gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() ));
+
+ GetQualAssDataMaker()->Init(AliQualAss::kRECPOINTS) ;
+ GetQualAssDataMaker()->SetData(gime->EmcRecPoints()) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ;
+ GetQualAssDataMaker()->SetData(gime->CpvRecPoints()) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ;
WriteRecPoints();
/* History of cvs commits:
*
* $Log$
+ * Revision 1.96 2007/04/28 10:43:36 policheh
+ * Dead channels simulation: digit energy sets to 0.
+ *
* Revision 1.95 2007/04/10 07:20:52 kharlov
* Decalibration should use the same CDB as calibration in AliPHOSClusterizerv1
*
#include "AliPHOSSDigitizer.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSTick.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp(AliPHOSDigitizer)
fNADCcpv(0),
fEventFolderName(""),
fFirstEvent(0),
- fLastEvent(0)
+ fLastEvent(0),
+ fQADM (0x0),
+ fEventCounter(0)
{
// ctor
InitParameters() ;
fNADCcpv(0),
fEventFolderName(eventFolderName),
fFirstEvent(0),
- fLastEvent(0)
+ fLastEvent(0),
+ fQADM (0x0),
+ fEventCounter(0)
{
// ctor
InitParameters() ;
Init() ;
fDefaultInit = kFALSE ;
fManager = 0 ; // We work in the standalong mode
+ //Initialize the quality assurance data maker only once
+ fQADM = new AliPHOSQualAssDataMaker() ;
+ GetQualAssDataMaker()->Init(AliQualAss::kDIGITS) ;
}
//____________________________________________________________________________
fNADCcpv(d.fNADCcpv),
fEventFolderName(d.fEventFolderName),
fFirstEvent(d.fFirstEvent),
- fLastEvent(d.fLastEvent)
+ fLastEvent(d.fLastEvent),
+ fQADM (d.fQADM),
+ fEventCounter(0)
+
{
// copyy ctor
SetName(d.GetName()) ;
SetTitle(d.GetTitle()) ;
+//Initialize the quality assurance data maker only once
+ GetQualAssDataMaker()->Init(AliQualAss::kDIGITS) ;
}
//____________________________________________________________________________
fNADCcpv(0),
fEventFolderName(fManager->GetInputFolderName(0)),
fFirstEvent(0),
- fLastEvent(0)
+ fLastEvent(0),
+ fQADM (0x0),
+ fEventCounter(0)
+
{
// ctor Init() is called by RunDigitizer
fManager = rd ;
SetTitle(dynamic_cast<AliStream*>(fManager->GetInputStream(0))->GetFileName(0));
InitParameters() ;
fDefaultInit = kFALSE ;
+//Initialize the quality assurance data maker only once
+ fQADM = new AliPHOSQualAssDataMaker() ;
+ GetQualAssDataMaker()->Init(AliQualAss::kDIGITS) ;
}
//____________________________________________________________________________
// dtor
delete [] fInputFileNames ;
delete [] fEventNames ;
-
+
+ delete fQADM ;
+
}
//____________________________________________________________________________
Int_t ievent ;
for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
-
+ fEventCounter++ ;
gime->Event(ievent,"S") ;
Digitize(ievent) ; //Add prepared SDigits to digits and add the noise
+ //makes the quality assurance data
+ GetQualAssDataMaker()->SetData(gime->Digits()) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kDIGITS) ;
+
WriteDigits() ;
if(strstr(option,"deb"))
//increment the total number of Digits per run
fDigitsInRun += gime->Digits()->GetEntriesFast() ;
}
+
+ //Write the quality assurance data only after the last event
+ if ( fEventCounter == gime->MaxEvent() )
+ GetQualAssDataMaker()->Finish(AliQualAss::kDIGITS) ;
gime->PhosLoader()->CleanDigitizer();
/* History of cvs commits:
*
* $Log$
+ * Revision 1.34 2006/04/29 20:25:30 hristov
+ * Decalibration is implemented (Yu.Kharlov)
+ *
* Revision 1.33 2005/05/28 14:19:04 schutz
* Compilation warnings fixed by T.P.
*
// --- AliRoot header files ---
#include "AliDigitizer.h"
class AliPHOSSDigitizer ;
+class AliPHOSQualAssDataMaker ;
class AliRunDigitizer ;
class AliPHOSDigitizer: public AliDigitizer {
return *this ;
}
+
private:
+ AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; }
virtual Bool_t Init() ;
void InitParameters() ;
Int_t fNADCcpv ; // number of channels in CPV ADC
TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode
- Int_t fFirstEvent; // first event to process
- Int_t fLastEvent; // last event to process
-
+ Int_t fFirstEvent; // first event to process
+ Int_t fLastEvent; // last event to process
+ AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
+ Int_t fEventCounter ; //! counts the events processed
+
ClassDef(AliPHOSDigitizer,3) // description
};
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+//_________________________________________________________________________
+// An analysis task to check the PHOS photon data in simulated data
+//
+//*-- Yves Schutz
+//////////////////////////////////////////////////////////////////////////////
+
+#include <TCanvas.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TH1.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TLegend.h>
+#include <TNtuple.h>
+#include <TROOT.h>
+#include <TVector3.h>
+#include <TString.h>
+
+#include "AliPHOSESDQA.h"
+#include "AliESD.h"
+#include "AliLog.h"
+
+//______________________________________________________________________________
+AliPHOSESDQA::AliPHOSESDQA(const char *name) :
+ AliAnalysisTask(name,""),
+ fChain(0),
+ fESD(0),
+ fhPHOS(0),
+ fhPHOSEnergy(0),
+ fhPHOSDigits(0),
+ fhPHOSRecParticles(0),
+ fhPHOSPhotons(0),
+ fhPHOSInvariantMass(0),
+ fhPHOSDigitsEvent(0)
+{
+ // Constructor.
+ // Input slot #0 works with an Ntuple
+ DefineInput(0, TChain::Class());
+ // Output slot #0 writes into a TH1 container
+ DefineOutput(0, TObjArray::Class()) ;
+}
+
+//______________________________________________________________________________
+AliPHOSESDQA::~AliPHOSESDQA()
+{
+ // dtor
+ fOutputContainer->Clear() ;
+ delete fOutputContainer ;
+
+ delete fhPHOSPos ;
+ delete fhPHOS ;
+ delete fhPHOSEnergy ;
+ delete fhPHOSDigits ;
+ delete fhPHOSRecParticles ;
+ delete fhPHOSPhotons ;
+ delete fhPHOSInvariantMass ;
+ delete fhPHOSDigitsEvent ;
+}
+
+
+//______________________________________________________________________________
+void AliPHOSESDQA::ConnectInputData(const Option_t*)
+{
+ // Initialisation of branch container and histograms
+
+ AliInfo(Form("*** Initialization of %s", GetName())) ;
+
+ // Get input data
+ fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
+ if (!fChain) {
+ AliError(Form("Input 0 for %s not found\n", GetName()));
+ return ;
+ }
+
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
+ }
+}
+
+//________________________________________________________________________
+void AliPHOSESDQA::CreateOutputObjects()
+{
+ // create histograms
+
+ OpenFile(0) ;
+
+ fhPHOSPos = new TNtuple("PHOSPos" , "Position in PHOS" , "x:y:z");
+ fhPHOS = new TNtuple("PHOS" , "PHOS" , "event:digits:clusters:photons");
+ fhPHOSEnergy = new TH1D("PHOSEnergy" , "PHOSEnergy" , 1000, 0., 10. ) ;
+ fhPHOSDigits = new TH1I("PHOSDigitsCluster" , "PHOSDigits" , 20 , 0 , 20 ) ;
+ fhPHOSRecParticles = new TH1D("PHOSRecParticles" , "PHOSRecParticles" , 20 , 0., 20. ) ;
+ fhPHOSPhotons = new TH1I("PHOSPhotons" , "PHOSPhotons" , 20 , 0 , 20 ) ;
+ fhPHOSInvariantMass = new TH1D("PHOSInvariantMass" , "PHOSInvariantMass" , 400, 0., 400.) ;
+ fhPHOSDigitsEvent = new TH1I("PHOSDigitsEvent" , "PHOSDigitsEvent" , 30 , 0 , 30 ) ;
+
+ // create output container
+
+ fOutputContainer = new TObjArray(8) ;
+ fOutputContainer->SetName(GetName()) ;
+
+ fOutputContainer->AddAt(fhPHOSPos, 0) ;
+ fOutputContainer->AddAt(fhPHOS, 1) ;
+ fOutputContainer->AddAt(fhPHOSEnergy, 2) ;
+ fOutputContainer->AddAt(fhPHOSDigits, 3) ;
+ fOutputContainer->AddAt(fhPHOSRecParticles, 4) ;
+ fOutputContainer->AddAt(fhPHOSPhotons, 5) ;
+ fOutputContainer->AddAt(fhPHOSInvariantMass, 6) ;
+ fOutputContainer->AddAt(fhPHOSDigitsEvent, 7) ;
+}
+
+//______________________________________________________________________________
+void AliPHOSESDQA::Exec(Option_t *)
+{
+ // Processing of one event
+
+ Long64_t entry = fChain->GetReadEntry() ;
+
+ if (!fESD) {
+ AliError("fESD is not connected to the input!") ;
+ return ;
+ }
+
+ if ( !((entry-1)%100) )
+ AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
+
+ //************************ PHOS *************************************
+
+ Int_t firstPhosCluster = fESD->GetFirstPHOSCluster() ;
+ const Int_t numberOfPhosClusters = fESD->GetNumberOfPHOSClusters() ;
+
+ TVector3 ** phosVector = new TVector3*[numberOfPhosClusters] ;
+ Float_t * phosPhotonsEnergy = new Float_t[numberOfPhosClusters] ;
+ Int_t phosCluster ;
+ Int_t numberOfPhotonsInPhos = 0 ;
+ Int_t numberOfDigitsInPhos = 0 ;
+
+ // loop over the PHOS Cluster
+ for(phosCluster = firstPhosCluster ; phosCluster < firstPhosCluster + numberOfPhosClusters ; phosCluster++) {
+ AliESDCaloCluster * caloCluster = fESD->GetCaloCluster(phosCluster) ;
+ if (caloCluster) {
+ Float_t pos[3] ;
+ caloCluster->GetPosition( pos ) ;
+ fhPHOSEnergy->Fill( caloCluster->E() ) ;
+ fhPHOSPos->Fill( pos[0], pos[1], pos[2] ) ;
+ fhPHOSDigits->Fill(entry, caloCluster->GetNumberOfDigits() ) ;
+ numberOfDigitsInPhos += caloCluster->GetNumberOfDigits() ;
+ Float_t * pid = caloCluster->GetPid() ;
+ if(pid[AliPID::kPhoton] > 0.9) {
+ phosVector[numberOfPhotonsInPhos] = new TVector3(pos[0],pos[1],pos[2]) ;
+ phosPhotonsEnergy[numberOfPhotonsInPhos]=caloCluster->E() ;
+ numberOfPhotonsInPhos++;
+ }
+ }
+ } //PHOS clusters
+
+ fhPHOSRecParticles->Fill(numberOfPhosClusters);
+ fhPHOSPhotons->Fill(numberOfPhotonsInPhos);
+ fhPHOSDigitsEvent->Fill(numberOfDigitsInPhos);
+ fhPHOS->Fill(entry, numberOfDigitsInPhos, numberOfPhosClusters, numberOfPhotonsInPhos) ;
+
+ // invariant Mass
+ if (numberOfPhotonsInPhos > 1 ) {
+ Int_t phosPhoton1, phosPhoton2 ;
+ for(phosPhoton1 = 0 ; phosPhoton1 < numberOfPhotonsInPhos ; phosPhoton1++) {
+ for(phosPhoton2 = phosPhoton1 + 1 ; phosPhoton2 < numberOfPhotonsInPhos ; phosPhoton2++) {
+ Float_t tempMass = TMath::Sqrt( 2 * phosPhotonsEnergy[phosPhoton1] * phosPhotonsEnergy[phosPhoton2] *
+ ( 1 - TMath::Cos(phosVector[phosPhoton1]->Angle(*phosVector[phosPhoton2])) )
+ );
+ fhPHOSInvariantMass->Fill(tempMass*1000.);
+ }
+ }
+ }
+
+ PostData(0, fOutputContainer);
+
+ delete [] phosVector ;
+ delete [] phosPhotonsEnergy ;
+
+}
+
+//______________________________________________________________________________
+void AliPHOSESDQA::Terminate(Option_t *)
+{
+ // Processing when the event loop is ended
+
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhPHOSPos = (TNtuple*)fOutputContainer->At(0);
+ fhPHOS = (TNtuple*)fOutputContainer->At(1);
+ fhPHOSEnergy = (TH1D*)fOutputContainer->At(2);
+ fhPHOSDigits = (TH1I*)fOutputContainer->At(3);
+ fhPHOSRecParticles = (TH1D*)fOutputContainer->At(4);
+ fhPHOSPhotons = (TH1I*)fOutputContainer->At(5);
+ fhPHOSInvariantMass = (TH1D*)fOutputContainer->At(6);
+ fhPHOSDigitsEvent = (TH1I*)fOutputContainer->At(7);
+
+ Bool_t problem = kFALSE ;
+ AliInfo(Form(" *** %s Report:", GetName())) ;
+ printf(" PHOSEnergy Mean : %5.3f , RMS : %5.3f \n", fhPHOSEnergy->GetMean(), fhPHOSEnergy->GetRMS() ) ;
+ printf(" PHOSDigits Mean : %5.3f , RMS : %5.3f \n", fhPHOSDigits->GetMean(), fhPHOSDigits->GetRMS() ) ;
+ printf(" PHOSRecParticles Mean : %5.3f , RMS : %5.3f \n", fhPHOSRecParticles->GetMean(), fhPHOSRecParticles->GetRMS() ) ;
+ printf(" PHOSPhotons Mean : %5.3f , RMS : %5.3f \n", fhPHOSPhotons->GetMean(), fhPHOSPhotons->GetRMS() ) ;
+ printf(" PHOSInvariantMass Mean : %5.3f , RMS : %5.3f \n", fhPHOSInvariantMass->GetMean(), fhPHOSInvariantMass->GetRMS() ) ;
+ printf(" PHOSDigitsEvent Mean : %5.3f , RMS : %5.3f \n", fhPHOSDigitsEvent->GetMean(), fhPHOSDigitsEvent->GetRMS() ) ;
+
+ TCanvas * cPHOS = new TCanvas("cPHOS", "PHOS ESD Test", 400, 10, 600, 700) ;
+ cPHOS->Divide(3, 2);
+
+ cPHOS->cd(1) ;
+ if ( fhPHOSEnergy->GetMaximum() > 0. )
+ gPad->SetLogy();
+ fhPHOSEnergy->SetAxisRange(0, 25.);
+ fhPHOSEnergy->SetLineColor(2);
+ fhPHOSEnergy->Draw();
+
+ cPHOS->cd(2) ;
+ fhPHOSDigits->SetAxisRange(0,25.);
+ fhPHOSDigits->SetLineColor(2);
+ fhPHOSDigits->Draw();
+
+ cPHOS->cd(3) ;
+ if ( fhPHOSRecParticles->GetMaximum() > 0. )
+ gPad->SetLogy();
+ fhPHOSRecParticles->SetAxisRange(0, 25.);
+ fhPHOSRecParticles->SetLineColor(2);
+ fhPHOSRecParticles->Draw();
+
+ cPHOS->cd(4) ;
+ if ( fhPHOSPhotons->GetMaximum() > 0. )
+ gPad->SetLogy();
+ fhPHOSPhotons->SetAxisRange(0,25.);
+ fhPHOSPhotons->SetLineColor(2);
+ fhPHOSPhotons->Draw();
+
+ cPHOS->cd(5) ;
+ fhPHOSInvariantMass->SetLineColor(2);
+ fhPHOSInvariantMass->Draw();
+
+ cPHOS->cd(6) ;
+ if ( fhPHOSDigitsEvent->GetMaximum() > 0. )
+ gPad->SetLogy();
+ fhPHOSDigitsEvent->SetAxisRange(0,40.);
+ fhPHOSDigitsEvent->SetLineColor(2);
+ fhPHOSDigitsEvent->Draw();
+
+ cPHOS->Print("PHOS.eps");
+
+ char line[1024] ;
+ sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
+ gROOT->ProcessLine(line);
+ sprintf(line, ".!rm -fR *.eps");
+ gROOT->ProcessLine(line);
+
+ AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
+
+ TString report ;
+ if(problem)
+ report="Problems found, please check!!!";
+ else
+ report="OK";
+
+ AliInfo(Form("*** %s Summary Report: %s \n",GetName(), report.Data())) ;
+}
--- /dev/null
+#ifndef ALIPHOSESDQA_H
+#define ALIPHOSESDQA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+//______________________________________________________________________________
+// An analysis task to check the PHOS photon ESD data
+//
+//*-- Yves Schutz
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliAnalysisTask.h"
+
+class AliESD ;
+class TH1D ;
+class TH1I ;
+
+class AliPHOSESDQA : public AliAnalysisTask {
+
+public:
+ AliPHOSESDQA(const char *name) ;
+ virtual ~AliPHOSESDQA() ;
+
+ virtual void Exec(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
+ virtual void Terminate(Option_t * opt = "") ;
+
+private:
+ TTree * fChain ; //!pointer to the analyzed TTree or TChain
+ AliESD * fESD ; //! Declaration of leave types
+
+ TObjArray * fOutputContainer ; //! output data container
+
+ // Histograms
+ TNtuple * fhPHOSPos ;
+ TNtuple * fhPHOS ;
+ TH1D * fhPHOSEnergy ;
+ TH1I * fhPHOSDigits ;
+ TH1D * fhPHOSRecParticles ;
+ TH1I * fhPHOSPhotons ;
+ TH1D * fhPHOSInvariantMass ;
+ TH1I * fhPHOSDigitsEvent ;
+
+ ClassDef(AliPHOSESDQA, 0); // a PHOS photon analysis task
+};
+#endif // ALIPHOSESDQA_H
#include "AliConfig.h"
#include "AliPHOSPID.h"
#include "AliPHOSGetter.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp(AliPHOSPID)
TTask("",""),
fEventFolderName(""),
fFirstEvent(0),
- fLastEvent(-1)
+ fLastEvent(-1),
+ fESD(0x0),
+ fQADM(0x0)
{
// ctor
}
TTask("PHOS"+AliConfig::Instance()->GetPIDTaskName(), alirunFileName),
fEventFolderName(eventFolderName),
fFirstEvent(0),
- fLastEvent(-1)
+ fLastEvent(-1),
+ fESD(0x0),
+ fQADM(0x0)
{
// ctor
+ fQADM = new AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker
+ GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;
}
//____________________________________________________________________________
AliPHOSPID::AliPHOSPID(const AliPHOSPID & pid) :
TTask(pid),fEventFolderName(pid.GetEventFolderName()),
- fFirstEvent(pid.GetFirstEvent()),fLastEvent(pid.GetLastEvent())
+ fFirstEvent(pid.GetFirstEvent()),fLastEvent(pid.GetLastEvent()),
+ fESD(pid.fESD),
+ fQADM(pid.fQADM)
{
// Copy constructor
}
//Remove this from the parental task before destroying
if(AliPHOSGetter::Instance()->PhosLoader())
AliPHOSGetter::Instance()->PhosLoader()->CleanPIDTask();
+ delete fQADM ;
}
/* History of cvs commits:
*
* $Log$
+ * Revision 1.39 2007/07/11 13:43:30 hristov
+ * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
+ *
* Revision 1.38 2007/04/01 15:40:15 kharlov
* Correction for actual vertex position implemented
*
class AliPHOSGeometry ;
class AliPHOSClusterizer ;
class AliPHOSTrackSegmentMaker ;
+class AliPHOSQualAssDataMaker ;
class AliPHOSPID : public TTask {
virtual const char * Version() const { Warning("Version", "not defined" ) ; return 0 ; }
virtual void WriteRecParticles() = 0;
+ AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; }
protected:
+
TString fEventFolderName ; // event folder name
Int_t fFirstEvent; // first event to process
Int_t fLastEvent; // last event to process
- AliESDEvent * fESD; //! ESD object
+ AliESDEvent * fESD; //! ESD object
private:
virtual void Init() { Warning("Init", "not defined" ) ; }
+ AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
ClassDef(AliPHOSPID,5) // Particle Identifier algorithm (base class)
/* History of cvs commits:
*
* $Log$
+ * Revision 1.112 2007/07/11 13:43:30 hristov
+ * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
+ *
* Revision 1.111 2007/05/04 14:49:29 policheh
* AliPHOSRecPoint inheritance from AliCluster
*
//____________________________________________________________________________
AliPHOSPIDv1::AliPHOSPIDv1() :
+ AliPHOSPID(),
fBayesian(kFALSE),
fDefaultInit(kFALSE),
fWrite(kFALSE),
fPPi0(0),
fRecParticlesInRun(0),
fParameters(0),
+ fVtx(0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fPPi0(0),
fRecParticlesInRun(0),
fParameters(0),
+ fVtx(0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fPPi0(0),
fRecParticlesInRun(0),
fParameters(0),
+ fVtx(0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+/*
+ Checks the quality assurance.
+ By comparing with reference data
+ Y. Schutz CERN July 2007
+*/
+
+// --- ROOT system ---
+#include <TClass.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TIterator.h>
+#include <TKey.h>
+#include <TFile.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQualAss.h"
+#include "AliQualAssChecker.h"
+#include "AliPHOSQualAssChecker.h"
+
+ClassImp(AliPHOSQualAssChecker)
+
+//__________________________________________________________________
+AliPHOSQualAssChecker& AliPHOSQualAssChecker::operator = (const AliPHOSQualAssChecker& qadm )
+{
+ // Equal operator.
+ this->~AliPHOSQualAssChecker();
+ new(this) AliPHOSQualAssChecker(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+const Double_t AliPHOSQualAssChecker::Check(const Option_t * opt)
+{
+ // Performs the checking
+
+ TDirectory * wRefDir = fDetectorDir->GetDirectory(opt) ;
+ TDirectory * wInDir = fDetectorDir ->GetDirectory(opt) ;
+ Double_t test = 0.0 ;
+
+ if (!wRefDir || !wInDir)
+ test = -1. ;
+ else {
+ TList * keyList = wRefDir->GetListOfKeys() ;
+ TIter next(keyList) ;
+ TKey * key ;
+ Int_t count = 0 ;
+ while ( (key = static_cast<TKey *>(next())) ) {
+ TObject * oref = wRefDir->Get(key->GetName()) ;
+ if ( oref->IsA()->InheritsFrom("TH1") ) {
+ TH1 * href = static_cast<TH1F*>(oref) ;
+ TH1 * hin = static_cast<TH1F*>(wInDir->Get(key->GetName())) ;
+ test += DiffK(href, hin) ;
+ AliInfo(Form("test = %f", test)) ;
+ count++ ;
+ } else
+ AliError(Form("%s is a class name that cannot be processed", key->GetClassName())) ;
+ }
+ if (count != 0)
+ test /= count ;
+ }
+
+ return test ;
+}
--- /dev/null
+#ifndef ALIPHOSQUALASSCHECKER_H
+#define ALIPHOSQUALASSCHECKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+/*
+ Checks the quality assurance.
+ By comparing with reference data
+ Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+class TFile ;
+class TH1F ;
+class TH1I ;
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQualAssCheckerBase.h"
+class AliPHOSLoader ;
+
+class AliPHOSQualAssChecker: public AliQualAssCheckerBase {
+
+public:
+ AliPHOSQualAssChecker() : AliQualAssCheckerBase("PHOS","PHOS Quality Assurance Data Maker") {;} // ctor
+ AliPHOSQualAssChecker(const AliPHOSQualAssChecker& qac) : AliQualAssCheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor
+ AliPHOSQualAssChecker& operator = (const AliPHOSQualAssChecker& qac) ;
+ virtual ~AliPHOSQualAssChecker() {;} // dtor
+
+private:
+
+ virtual const Double_t Check(const Option_t * opt) ;
+
+ ClassDef(AliPHOSQualAssChecker,1) // description
+
+};
+
+#endif // AliPHOSQualAssChecker_H
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+/* $Id$ */
+
+/*
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TH1F.h>
+#include <TH1I.h>
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDCaloCluster.h"
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliPHOSDigit.h"
+#include "AliPHOSHit.h"
+#include "AliPHOSQualAssDataMaker.h"
+#include "AliPHOSCpvRecPoint.h"
+#include "AliPHOSEmcRecPoint.h"
+#include "AliPHOSRecParticle.h"
+#include "AliPHOSTrackSegment.h"
+
+ClassImp(AliPHOSQualAssDataMaker)
+
+//____________________________________________________________________________
+ AliPHOSQualAssDataMaker::AliPHOSQualAssDataMaker() :
+ AliQualAssDataMaker("PHOSQA", "PHOS Quality Assurance Data Maker"),
+ fhHits(0x0),
+ fhHitsMul(0x0),
+ fhDigits(0x0),
+ fhDigitsMul(0x0),
+ fhSDigits(0x0),
+ fhSDigitsMul(0x0),
+ fhEmcRecPoints(0x0),
+ fhEmcRecPointsMul(0x0),
+ fhCpvRecPoints(0x0),
+ fhCpvRecPointsMul(0x0),
+ fhTrackSegments(0x0),
+ fhTrackSegmentsMul(0x0),
+ fhRecParticles(0x0),
+ fhRecParticlesMul(0x0),
+ fhESDs(0x0),
+ fhESDsMul(0x0)
+{
+ // ctor
+ fDetectorDir = fOutput->GetDirectory(GetName()) ;
+ if (!fDetectorDir)
+ fDetectorDir = fOutput->mkdir(GetName()) ;
+}
+
+//____________________________________________________________________________
+AliPHOSQualAssDataMaker::AliPHOSQualAssDataMaker(const AliPHOSQualAssDataMaker& qadm) :
+ AliQualAssDataMaker(),
+ fhHits(qadm.fhHits),
+ fhHitsMul(qadm.fhHitsMul),
+ fhDigits(qadm.fhDigits),
+ fhDigitsMul(qadm.fhDigitsMul),
+ fhSDigits(qadm.fhSDigits),
+ fhSDigitsMul(qadm.fhSDigitsMul),
+ fhEmcRecPoints(qadm.fhEmcRecPoints),
+ fhEmcRecPointsMul(qadm.fhEmcRecPointsMul),
+ fhCpvRecPoints(qadm.fhCpvRecPoints),
+ fhCpvRecPointsMul(qadm.fhCpvRecPointsMul),
+ fhTrackSegments(qadm.fhTrackSegments),
+ fhTrackSegmentsMul(qadm.fhTrackSegmentsMul),
+ fhRecParticles(qadm.fhRecParticles),
+ fhRecParticlesMul(qadm.fhRecParticlesMul),
+ fhESDs(qadm.fhESDs),
+ fhESDsMul(qadm.fhESDsMul)
+{
+ //copy ctor
+ SetName((const char*)qadm.GetName()) ;
+ SetTitle((const char*)qadm.GetTitle());
+}
+
+//__________________________________________________________________
+AliPHOSQualAssDataMaker& AliPHOSQualAssDataMaker::operator = (const AliPHOSQualAssDataMaker& qadm )
+{
+ // Equal operator.
+ this->~AliPHOSQualAssDataMaker();
+ new(this) AliPHOSQualAssDataMaker(qadm);
+ return *this;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitESDs()
+{
+ //create ESDs histograms in ESDs subdir
+ fhESDs = new TH1F("hPhosESDs", "ESDs energy distribution in PHOS", 100, 0., 100.) ;
+ fhESDsMul = new TH1I("hPhosESDsMul", "ESDs multiplicity distribution in PHOS", 100, 0., 100) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitHits()
+{
+ // create Hits histograms in Hits subdir
+ fhHits = new TH1F("hPhosHits", "Hits energy distribution in PHOS", 100, 0., 100.) ;
+ fhHitsMul = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitDigits()
+{
+ // create Digits histograms in Digits subdir
+ fhDigits = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS", 500, 0, 5000) ;
+ fhDigitsMul = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 500, 0, 1000) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitRecParticles()
+{
+ // create Reconstructed particles histograms in RecParticles subdir
+ fhRecParticles = new TH1F("hPhosRecParticles", "RecParticles energy distribution in PHOS", 100, 0., 100.) ;
+ fhRecParticlesMul = new TH1I("hPhosRecParticlesMul", "RecParticles multiplicity distribution in PHOS", 100, 0, 100) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitRecPoints()
+{
+ // create Reconstructed Points histograms in RecPoints subdir
+ fhEmcRecPoints = new TH1F("hEmcPhosRecPoints", "EMCA RecPoints energy distribution in PHOS", 100, 0., 100.) ;
+ fhEmcRecPointsMul = new TH1I("hEmcPhosRecPointsMul", "EMCA RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
+
+ fhCpvRecPoints = new TH1F("hCpvPhosRecPoints", "CPV RecPoints energy distribution in PHOS", 100, 0., 100.) ;
+ fhCpvRecPointsMul = new TH1I("hCpvPhosRecPointsMul", "CPV RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitSDigits()
+{
+ // create SDigits histograms in SDigits subdir
+ fhSDigits = new TH1F("hPhosSDigits", "SDigits energy distribution in PHOS", 100, 0., 100.) ;
+ fhSDigitsMul = new TH1I("hPhosSDigitsMul", "SDigits multiplicity distribution in PHOS", 500, 0, 10000) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::InitTrackSegments()
+{
+ // create Track Segments histograms in TrackSegments subdir
+ fhTrackSegments = new TH1F("hPhosTrackSegments", "TrackSegments EMC-CPV distance in PHOS", 500, 0., 5000.) ;
+ fhTrackSegmentsMul = new TH1I("hPhosTrackSegmentsMul", "TrackSegments multiplicity distribution in PHOS", 100, 0, 100) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeESDs()
+{
+ // make QA data from ESDs
+
+ AliESDEvent * esd = dynamic_cast<AliESDEvent*>(fData) ;
+ Int_t maxClu = esd->GetNumberOfPHOSClusters() ;
+ Int_t index = 0, count = 0 ;
+ for ( index = 0 ; index < maxClu; index++ ) {
+ AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
+ fhESDs->Fill(clu->E()) ;
+ count++ ;
+ }
+ fhESDsMul->Fill(count) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeHits()
+{
+ //make QA data from Hits
+
+ TClonesArray * hits = dynamic_cast<TClonesArray*>(fData) ;
+ fhHitsMul->Fill(hits->GetEntriesFast()) ;
+ TIter next(hits) ;
+ AliPHOSHit * hit ;
+ while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) {
+ fhHits->Fill( hit->GetEnergy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeDigits()
+{
+ // makes data from Digits
+
+ TClonesArray * digits = dynamic_cast<TClonesArray*>(fData) ;
+ fhDigitsMul->Fill(digits->GetEntriesFast()) ;
+ TIter next(digits) ;
+ AliPHOSDigit * digit ;
+ while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) {
+ fhDigits->Fill( digit->GetEnergy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeRecParticles()
+{
+ // makes data from RecParticles
+
+ TClonesArray * recparticles = dynamic_cast<TClonesArray*>(fData) ;
+ fhRecParticlesMul->Fill(recparticles->GetEntriesFast()) ;
+ TIter next(recparticles) ;
+ AliPHOSRecParticle * recparticle ;
+ while ( (recparticle = dynamic_cast<AliPHOSRecParticle *>(next())) ) {
+ fhRecParticles->Fill( recparticle->Energy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeRecPoints()
+{
+ // makes data from RecPoints
+ TObjArray * recpoints = dynamic_cast<TObjArray*>(fData) ;
+ TIter next(recpoints) ;
+
+ if ( strcmp(fData->GetName(), "EMCRECPOINTS") == 0 ) {
+ fhEmcRecPointsMul->Fill(recpoints->GetEntriesFast()) ;
+ AliPHOSEmcRecPoint * rp ;
+ while ( (rp = dynamic_cast<AliPHOSEmcRecPoint *>(next())) ) {
+ fhEmcRecPoints->Fill( rp->GetEnergy()) ;
+ }
+ }
+ else if ( strcmp(fData->GetName(), "CPVRECPOINTS") == 0 ) {
+ fhCpvRecPointsMul->Fill(recpoints->GetEntriesFast()) ;
+ AliPHOSCpvRecPoint * rp ;
+ while ( (rp = dynamic_cast<AliPHOSCpvRecPoint *>(next())) ) {
+ fhCpvRecPoints->Fill( rp->GetEnergy()) ;
+ }
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeSDigits()
+{
+ // makes data from SDigits
+
+ TClonesArray * sdigits = dynamic_cast<TClonesArray*>(fData) ;
+ fhSDigitsMul->Fill(sdigits->GetEntriesFast()) ;
+ TIter next(sdigits) ;
+ AliPHOSDigit * sdigit ;
+ while ( (sdigit = dynamic_cast<AliPHOSDigit *>(next())) ) {
+ fhSDigits->Fill( sdigit->GetEnergy()) ;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::MakeTrackSegments()
+{
+ // makes data from TrackSegments
+
+ TClonesArray * tracksegments = dynamic_cast<TClonesArray*>(fData) ;
+
+ fhTrackSegmentsMul->Fill(tracksegments->GetEntriesFast()) ;
+ TIter next(tracksegments) ;
+ AliPHOSTrackSegment * ts ;
+ while ( (ts = dynamic_cast<AliPHOSTrackSegment *>(next())) ) {
+ fhTrackSegments->Fill( ts->GetCpvDistance()) ;
+ }
+}
--- /dev/null
+#ifndef ALIPHOSQUALASSDATAMAKER_H
+#define ALIPHOSQUALASSDATAMAKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+/* $Id$ */
+
+/*
+ Produces the data needed to calculate the quality assurance.
+ All data must be mergeable objects.
+ Y. Schutz CERN July 2007
+*/
+
+
+// --- ROOT system ---
+class TH1F ;
+class TH1I ;
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliQualAssDataMaker.h"
+
+class AliPHOSQualAssDataMaker: public AliQualAssDataMaker {
+
+public:
+ AliPHOSQualAssDataMaker() ; // ctor
+ AliPHOSQualAssDataMaker(const AliPHOSQualAssDataMaker& qadm) ;
+ AliPHOSQualAssDataMaker& operator = (const AliPHOSQualAssDataMaker& qadm) ;
+ virtual ~AliPHOSQualAssDataMaker() {;} // dtor
+
+private:
+ virtual void InitHits() ;
+ virtual void InitESDs() ;
+ virtual void InitDigits() ;
+ virtual void InitRecParticles() ;
+ virtual void InitRecPoints() ;
+ virtual void InitTrackSegments() ;
+ virtual void InitSDigits() ;
+ virtual void MakeESDs() ;
+ virtual void MakeHits() ;
+ virtual void MakeDigits() ;
+ virtual void MakeRecParticles() ;
+ virtual void MakeRecPoints() ;
+ virtual void MakeSDigits() ;
+ virtual void MakeTrackSegments() ;
+
+ TH1F * fhHits ; //! hits energy histogram
+ TH1I * fhHitsMul ; //! hits multiplicity histogram
+ TH1I * fhDigits ; //! digits energy histogram
+ TH1I * fhDigitsMul ; //! digits multiplicity histogram
+ TH1F * fhSDigits ; //! sdigits energy histogram
+ TH1I * fhSDigitsMul ; //! sdigits multiplicity histogram
+ TH1F * fhEmcRecPoints ; //! Emc recpoints energy histogram
+ TH1I * fhEmcRecPointsMul ; //! emc recpoints multiplicity histogram
+ TH1F * fhCpvRecPoints ; //! cpv recpoints energy histogram
+ TH1I * fhCpvRecPointsMul ; //! cpv recpoints multiplicity histogram
+ TH1F * fhTrackSegments ; //! tracksegments energy histogram
+ TH1I * fhTrackSegmentsMul ;//! tracksegments multiplicity histogram
+ TH1F * fhRecParticles ; //! recparticles energy histogram
+ TH1I * fhRecParticlesMul ; //! recparticles multiplicity histogram
+ TH1F * fhESDs ; //! ESDs energy histogram
+ TH1I * fhESDsMul ; //! ESDs multiplicity histogram
+
+ ClassDef(AliPHOSQualAssDataMaker,1) // description
+
+};
+
+#endif // AliPHOSQualAssDataMaker_H
/* History of cvs commits:
*
* $Log$
+ * Revision 1.50 2006/08/28 10:01:56 kharlov
+ * Effective C++ warnings fixed (Timur Pocheptsov)
+ *
* Revision 1.49 2006/05/10 06:42:53 kharlov
* Remove redundant loop over primaries
*
#include "AliPHOSGetter.h"
#include "AliPHOSHit.h"
#include "AliPHOSSDigitizer.h"
-//#include "AliMemoryWatcher.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp(AliPHOSSDigitizer)
fInit(kFALSE),
fSDigitsInRun(0),
fFirstEvent(0),
- fLastEvent(0)
+ fLastEvent(0),
+ fQADM (0x0)
{
// ctor
+ // Intialize the quality assurance data maker
}
//____________________________________________________________________________
fInit(kFALSE),
fSDigitsInRun(0),
fFirstEvent(0),
- fLastEvent(0)
+ fLastEvent(0),
+ fQADM (0x0)
{
// ctor
InitParameters() ;
Init();
fDefaultInit = kFALSE ;
+ // Intialize the quality assurance data maker
+ GetQualAssDataMaker()->Init(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->Init(AliQualAss::kSDIGITS) ;
+}
+
+//____________________________________________________________________________
+AliPHOSSDigitizer::AliPHOSSDigitizer(const AliPHOSSDigitizer& sd) :
+ TTask(sd.GetName(), sd.GetTitle()),
+ fA(sd.fA), fB(sd.fB),
+ fPrimThreshold(sd.fPrimThreshold),
+ fDefaultInit(kFALSE),
+ fEventFolderName(sd.fEventFolderName),
+ fInit(kFALSE),
+ fSDigitsInRun(sd.fSDigitsInRun),
+ fFirstEvent(sd.fFirstEvent),
+ fLastEvent(sd.fLastEvent),
+ fQADM (sd.fQADM)
+{
+ // cpy ctor
+ // Intialize the quality assurance data maker
+ GetQualAssDataMaker()->Init(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->Init(AliQualAss::kSDIGITS) ;
+}
+
+
+//_____________________________________________________________________________
+AliPHOSSDigitizer& AliPHOSSDigitizer::operator = (const AliPHOSSDigitizer& qa)
+{
+// assignment operator
+
+ this->~AliPHOSSDigitizer();
+ new(this) AliPHOSSDigitizer(qa);
+ return *this;
}
//____________________________________________________________________________
AliPHOSGetter * gime =
AliPHOSGetter::Instance();
gime->PhosLoader()->CleanSDigitizer();
+ delete fQADM ;
}
+
//____________________________________________________________________________
void AliPHOSSDigitizer::Init()
{
gime->PostSDigitizer(this);
gime->PhosLoader()->GetSDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE);
+ fQADM = new AliPHOSQualAssDataMaker() ;
+
}
//____________________________________________________________________________
digit->SetIndexInList(i) ;
}
+ // make Quality Assurance data
+
+ GetQualAssDataMaker()->SetData(hits) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->SetData(sdigits) ;
+ GetQualAssDataMaker()->Exec(AliQualAss::kSDIGITS) ;
+
+
//Now write SDigits
//memwatcher.Watch(ievent);
}// event loop
+ //Write the quality assurance data
+ GetQualAssDataMaker()->Finish(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->Finish(AliQualAss::kSDIGITS) ;
+
Unload();
// gime->PhosLoader()->GetSDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE);
/* History of cvs commits:
*
* $Log$
+ * Revision 1.26 2006/08/28 10:01:56 kharlov
+ * Effective C++ warnings fixed (Timur Pocheptsov)
+ *
* Revision 1.25 2005/11/30 18:56:26 schutz
* Small corrections to fix compilation errors
*
// --- Standard library ---
// --- AliRoot header files ---
+class AliPHOSQualAssDataMaker ;
class AliPHOSSDigitizer: public TTask {
public:
AliPHOSSDigitizer() ; // ctor
AliPHOSSDigitizer(const char * alirunFileName, const char * eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
+ AliPHOSSDigitizer(const AliPHOSSDigitizer& sd) ;
+ AliPHOSSDigitizer& operator = (const AliPHOSSDigitizer& sd) ;
virtual ~AliPHOSSDigitizer(); // dtor
void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
Bool_t operator == (const AliPHOSSDigitizer & sd) const ;
-
+
+
private:
+ AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; }
+
void Init() ;
void InitParameters() ;
void PrintSDigits(Option_t * option) ;
Int_t fSDigitsInRun ; //! Total number of sdigits in one run
Int_t fFirstEvent; // first event to process
Int_t fLastEvent; // last event to process
+ AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
ClassDef(AliPHOSSDigitizer,3) // description
/* History of cvs commits:
*
* $Log$
+ * Revision 1.27 2006/08/25 16:56:30 kharlov
+ * Compliance with Effective C++
+ *
* Revision 1.26 2006/08/25 16:00:53 kharlov
* Compliance with Effective C++AliPHOSHit.cxx
*
// --- AliRoot header files ---
#include "AliPHOSTrackSegmentMaker.h"
#include "AliPHOSGetter.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp( AliPHOSTrackSegmentMaker)
fEventFolderName(""),
fFirstEvent(0),
fLastEvent(-1),
- fESD(0)
+ fESD(0),
+ fQADM(0x0)
{
- // ctor
+ // ctor
}
//____________________________________________________________________________
fEventFolderName(eventFolderName),
fFirstEvent(0),
fLastEvent(-1),
- fESD(0)
+ fESD(0),
+ fQADM(0x0)
{
// ctor
+ fQADM = new AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker
+ GetQualAssDataMaker()->Init(AliQualAss::kTRACKSEGMENTS) ;
}
//____________________________________________________________________________
fEventFolderName(tsmaker.GetEventFolderName()),
fFirstEvent(tsmaker.GetFirstEvent()),
fLastEvent(tsmaker.GetLastEvent()),
- fESD(tsmaker.GetESD())
+ fESD(tsmaker.GetESD()),
+ fQADM(tsmaker.fQADM)
{
//Copy constructor
}
//Remove this from the parental task before destroying
if(AliPHOSGetter::Instance()->PhosLoader())
AliPHOSGetter::Instance()->PhosLoader()->CleanTracker();
+ delete fQADM ;
}
/* History of cvs commits:
*
* $Log$
+ * Revision 1.41 2007/07/11 13:43:30 hristov
+ * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
+ *
* Revision 1.40 2006/08/29 11:41:19 kharlov
* Missing implementation of ctors and = operator are added
*
//#include <iostream>
// --- AliRoot header files ---
-
-
class AliPHOSClusterizer ;
class AliPHOSGeometry ;
class AliESDEvent ;
+class AliPHOSQualAssDataMaker ;
class AliPHOSTrackSegmentMaker : public TTask {
virtual void WriteTrackSegments() = 0;
+ AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; }
+
protected:
+
TString fEventFolderName ; // event folder name
Int_t fFirstEvent; // first event to process
Int_t fLastEvent; // last event to process
AliESDEvent * fESD; //! ESD object
+ AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
+
ClassDef( AliPHOSTrackSegmentMaker,5) // Algorithm class to make PHOS track segments (Base Class)
};
/* History of cvs commits:
*
* $Log$
+ * Revision 1.90 2007/07/11 13:43:30 hristov
+ * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
+ *
* Revision 1.89 2007/07/03 08:13:04 kharlov
* Bug fix in CPV local coordinates
*
#include "AliPHOSGetter.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
+#include "AliPHOSQualAssDataMaker.h"
ClassImp( AliPHOSTrackSegmentMakerv1)
fNTrackSegments(0),
fRcpv(0.f),
fRtpc(0.f),
+ fVtx(0.f),
fLinkUpArray(0),
fEmcFirst(0),
fEmcLast(0),
fNTrackSegments(0),
fRcpv(0.f),
fRtpc(0.f),
+ fVtx(0.f),
fLinkUpArray(0),
fEmcFirst(0),
fEmcLast(0),
fNTrackSegments(0),
fRcpv(0.f),
fRtpc(0.f),
+ fVtx(0.f),
fLinkUpArray(0),
fEmcFirst(0),
fEmcLast(0),
// clusters from one PHOS module are
AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
-
TObjArray * emcRecPoints = gime->EmcRecPoints() ;
TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
-
+
//First EMC clusters
Int_t totalEmc = emcRecPoints->GetEntriesFast() ;
for(fEmcFirst = fEmcLast; (fEmcLast < totalEmc) &&
gime->TrackSegments()->Clear();
- // if(!ReadRecPoints(ievent)) continue; //reads RecPoints for event ievent
+ // if(!ReadRecPoints(ievent)) continue; //reads RecPoints for event ievent
for(fModule = 1; fModule <= geom->GetNModules() ; fModule++ ) {
FillOneModule() ;
MakeLinks() ;
MakePairs() ;
}
-
+
+
WriteTrackSegments() ;
if(strstr(option,"deb"))
/* History of cvs commits:
*
* $Log$
+ * Revision 1.6 2007/08/03 14:41:37 cvetan
+ * Missing header files
+ *
* Revision 1.5 2007/08/03 13:52:16 kharlov
* Working skeleton of matching the ESD tracks and ESD clusters (Iouri Belikov)
*
#include "AliPHOSTracker.h"
#include "AliPHOSEmcRecPoint.h"
#include "AliESDEvent.h"
+#include "AliPHOSQualAssDataMaker.h"
+#include "AliPHOSGetter.h"
#include "AliESDtrack.h"
+#include "AliPHOSTrackSegmentMakerv1.h"
+#include "AliPHOSPIDv1.h"
//-------------------------------------------------------------------------
// PHOS tracker.
-AliPHOSTracker::AliPHOSTracker(): AliTracker(), fRunLoader(0) {
+//____________________________________________________________________________
+AliPHOSTracker::AliPHOSTracker():
+ AliTracker(),
+ fRunLoader(0),
+ fTSM(0x0),
+ fPID(0x0)
+{
//--------------------------------------------------------------------
// The default constructor
//--------------------------------------------------------------------
for (Int_t i=0; i<5; i++)
fModules[i]=new TClonesArray("AliPHOSEmcRecPoint",777);
+
+ fTSM = new AliPHOSTrackSegmentMakerv1("to be set", "to be set");
+ fTSM->GetQualAssDataMaker()->Init(AliQualAss::kTRACKSEGMENTS) ;
+ fPID = new AliPHOSPIDv1("to be set", "to be set");
+ fPID->GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;
}
-AliPHOSTracker::~AliPHOSTracker() {
+//____________________________________________________________________________
+AliPHOSTracker::~AliPHOSTracker()
+{
//--------------------------------------------------------------------
// The destructor
//--------------------------------------------------------------------
(fModules[i])->Delete();
delete fModules[i];
}
+ delete fTSM ;
+ delete fPID ;
}
+//____________________________________________________________________________
Int_t AliPHOSTracker::LoadClusters(TTree *cTree) {
//--------------------------------------------------------------------
// This function loads the PHOS clusters
return 0;
}
-
+//____________________________________________________________________________
Int_t AliPHOSTracker::PropagateBack(AliESDEvent *esd) {
//--------------------------------------------------------------------
// Called by AliReconstruction
return 0;
}
+//____________________________________________________________________________
AliCluster *AliPHOSTracker::GetCluster(Int_t index) const {
//--------------------------------------------------------------------
// Returns the pointer to a given cluster
return (AliCluster*)(fModules[m])->UncheckedAt(i);
}
+//____________________________________________________________________________
void AliPHOSTracker::UnloadClusters() {
//--------------------------------------------------------------------
// This function unloads the PHOS clusters
#include "AliPHOSPIDv1.h"
#include "AliRunLoader.h"
+//____________________________________________________________________________
Int_t AliPHOSTracker::PropagateBackOld(AliESDEvent *esd) {
// Bad function: it uses RunLoader ;(
// Creates the tracksegments and Recparticles
// Makes the PID
- Int_t eventNumber = fRunLoader->GetEventNumber() ;
-
- TString headerFile(fRunLoader->GetFileName()) ;
- TString branchName(fRunLoader->GetEventFolder()->GetName()) ;
-
- AliPHOSTrackSegmentMakerv1 tsm(headerFile, branchName);
-// AliPHOSTrackSegmentMakerv2 tsm(headerFile, branchName);
- tsm.SetESD(esd) ;
- AliPHOSPIDv1 pid(headerFile, branchName);
- pid.SetESD(esd) ;
+ AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
+ Int_t eventNumber = gime->PhosLoader()->GetRunLoader()->GetEventNumber() ;
- //PH SetDebug() ;
+ TString headerFile(gime->PhosLoader()->GetRunLoader()->GetFileName()) ;
+ TString branchName(gime->PhosLoader()->GetRunLoader()->GetEventFolder()->GetName()) ;
// do current event; the loop over events is done by AliReconstruction::Run()
- tsm.SetEventRange(eventNumber, eventNumber) ;
- pid.SetEventRange(eventNumber, eventNumber) ;
- if ( Debug() ) {
- tsm.ExecuteTask("deb all") ;
- pid.ExecuteTask("deb all") ;
- }
- else {
- tsm.ExecuteTask("") ;
- pid.ExecuteTask("") ;
- }
+
+ fTSM->SetTitle(headerFile) ;
+ fTSM->SetEventFolderName(branchName) ;
+ fTSM->SetESD(esd) ;
+ fTSM->SetEventRange(eventNumber, eventNumber) ;
+ if ( Debug() )
+ fTSM->ExecuteTask("deb all") ;
+ else
+ fTSM->ExecuteTask("") ;
+
+ fTSM->GetQualAssDataMaker()->SetData(gime->TrackSegments()) ;
+ fTSM->GetQualAssDataMaker()->Exec(AliQualAss::kTRACKSEGMENTS) ;
+
+ fPID->SetTitle(headerFile) ;
+ fPID->SetEventFolderName(branchName) ;
+ fPID->SetESD(esd) ;
+ fPID->SetEventRange(eventNumber, eventNumber) ;
+ if ( Debug() )
+ fPID->ExecuteTask("deb all") ;
+ else
+ fPID->ExecuteTask("") ;
+
+ fPID->GetQualAssDataMaker()->SetData(gime->RecParticles()) ;
+ fPID->GetQualAssDataMaker()->Exec(AliQualAss::kRECPARTICLES) ;
+ if ( eventNumber == gime->MaxEvent()-1 ) {
+ fTSM->GetQualAssDataMaker()->Finish(AliQualAss::kTRACKSEGMENTS) ;
+ fPID->GetQualAssDataMaker()->Finish(AliQualAss::kRECPARTICLES) ;
+ }
+
return 0;
}
-AliPHOSTracker::AliPHOSTracker(AliRunLoader *l): AliTracker(), fRunLoader(l) {
+//____________________________________________________________________________
+AliPHOSTracker::AliPHOSTracker(AliRunLoader *l) :
+ AliTracker(),
+ fRunLoader(0),
+ fTSM(0x0),
+ fPID(0x0)
+{
//--------------------------------------------------------------------
// Bad constructor: uses RunLoader ;(
//--------------------------------------------------------------------
for (Int_t i=0; i<5; i++)
fModules[i]=new TClonesArray("AliPHOSEmcRecPoint",777);
+ fTSM = new AliPHOSTrackSegmentMakerv1("to be set", "to be set");
+ fPID = new AliPHOSPIDv1("to be set", "to be set");
}
/* History of cvs commits:
*
* $Log$
+ * Revision 1.4 2007/08/03 13:52:16 kharlov
+ * Working skeleton of matching the ESD tracks and ESD clusters (Iouri Belikov)
+ *
*/
//-------------------------------------------------------------------------
class AliCluster;
class AliESDEvent;
+class AliPHOSTrackSegmentMaker ;
+class AliPHOSPID ;
class AliPHOSTracker : public AliTracker
{
static Bool_t fgDebug ; //! Verbosity controller
TClonesArray *fModules[5];
-
+
+ AliPHOSTrackSegmentMaker * fTSM ; //! the track segment maker
+ AliPHOSPID * fPID ; //! the pid maker
ClassDef(AliPHOSTracker,1)
};
#pragma link C++ class AliPHOSSurvey+;
#pragma link C++ class AliPHOSSurvey1+;
+#pragma link C++ class AliPHOSQualAssDataMaker+;
+#pragma link C++ class AliPHOSQualAssChecker+;
+
#endif
AliPHOSRawDigiProducer.cxx \
AliPHOSEmcBadChannelsMap.cxx \
AliPHOSSurvey.cxx \
- AliPHOSSurvey1.cxx
+ AliPHOSSurvey1.cxx \
+ AliPHOSQualAssDataMaker.cxx \
+ AliPHOSQualAssChecker.cxx
HDRS:= $(SRCS:.cxx=.h)