Code clean up
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Feb 2008 19:26:27 +0000 (19:26 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Feb 2008 19:26:27 +0000 (19:26 +0000)
FMD/AliFMDQAChecker.h
FMD/AliFMDQADataMakerRec.cxx
FMD/AliFMDQADataMakerRec.h
FMD/AliFMDQADataMakerSim.cxx
FMD/MakeFMDFullMisAlignment.C
FMD/MakeFMDResMisAlignment.C
FMD/MakeFMDZeroMisAlignment.C

index 68786ce..1d311d7 100644 (file)
@@ -5,20 +5,21 @@
  *
  * See cxx source for full Copyright notice                               
  */
-
+#include "AliQACheckerBase.h"
 class TFile; 
 class TH1F; 
 class TH1I; 
 
-#include "AliQACheckerBase.h"
-
+/** @class AliFMDQAChecker 
+    @brief Quality assurance checker for the FMD */
 class AliFMDQAChecker : public AliQACheckerBase 
 {
 public:
+  /** Constructor */
   AliFMDQAChecker() 
     : AliQACheckerBase("FMD","FMD Quality Assurance Checker") 
   {}          
+  /** Destructor */
   virtual ~AliFMDQAChecker() {}
 
 private:
index a01a29e..478afdb 100644 (file)
@@ -56,10 +56,10 @@ AliFMDQADataMakerRec::AliFMDQADataMakerRec() :
 }
 
 //_____________________________________________________________________
-AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) :
-  AliQADataMakerRec()
+AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) 
+  AliQADataMakerRec()
 {
-  //copy ctor 
+  // copy ctor 
   // Parameters: 
   //    qadm    Object to copy from
   
@@ -74,7 +74,10 @@ AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task,
 {
   // Detector specific actions at end of cycle
   // do the QA checking
-  AliLog::Message(5,"FMD: end of detector cycle","AliFMDQADataMakerRec","AliFMDQADataMakerRec","AliFMDQADataMakerRec::EndOfDetectorCycle","AliFMDQADataMakerRec.cxx",95);
+  AliLog::Message(5,"FMD: end of detector cycle",
+                 "AliFMDQADataMakerRec","AliFMDQADataMakerRec",
+                 "AliFMDQADataMakerRec::EndOfDetectorCycle",
+                 "AliFMDQADataMakerRec.cxx",95);
   AliQAChecker::Instance()->Run(AliQA::kFMD, task, list);
 }
 
@@ -95,14 +98,9 @@ void AliFMDQADataMakerRec::InitDigits()
   // create Digits histograms in Digits subdir
   TH1I* hADCCounts      = new TH1I("hADCCounts","Dist of ADC counts",
                                   1024,0,1024);
-  // TH1F* hEnergyOfDigits = new TH1F("hEnergyOfDigits", "Energy distribution",
-  // 100,0,3);
   hADCCounts->SetXTitle("ADC counts");
   hADCCounts->SetYTitle("");
-  // hEnergyOfDigits->SetXTitle("Edep/Emip");
-  // hEnergyOfDigits->SetYTitle("Counts");
   Add2DigitsList(hADCCounts, 0);
-  // Add2DigitsList(hEnergyOfDigits, 1);
   
 }
 
@@ -154,8 +152,8 @@ void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
 {
   // makes data from Digits  
   if(!digits)  {
-      AliError("FMD Digit object not found!!") ;
-      return;
+    AliError("FMD Digit object not found!!") ;
+    return;
   }
   for(Int_t i=0;i<digits->GetEntries();i++) {
     //Raw ADC counts
@@ -168,16 +166,16 @@ void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
 void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
 {
   
-  TClonesArray* digits = new TClonesArray("AliFMDDigit", 1000) 
-  TBranch*      branch = digitTree->GetBranch("FMD") ;
-  if (!branch ) {
+  TClonesArray* digits = new TClonesArray("AliFMDDigit", 1000); 
+  TBranch*      branch = digitTree->GetBranch("FMD");
+  if (!branch) {
     AliWarning("FMD branch in Digit Tree not found") ; 
     return;
   } 
   
-  branch->SetAddress(&digits) ;
-  branch->GetEntry(0) 
-  MakeDigits(digits) 
+  branch->SetAddress(&digits);
+  branch->GetEntry(0); 
+  MakeDigits(digits); 
 }
 
 //_____________________________________________________________________
@@ -196,7 +194,7 @@ void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
     return;
   }
   
-  TClonesArray * fmdrecpoints = new TClonesArray("AliFMDRecPoint", 1000) ;
+  TClonesArray * fmdrecpoints = new TClonesArray("AliFMDRecPoint", 1000);
   fmdbranch->SetAddress(&fmdrecpoints);
   fmdbranch->GetEntry(0);
     
index d1f7160..4f35f17 100644 (file)
@@ -18,14 +18,13 @@ class TList;
 // Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
 //_____________________________________________________________________
 
-class AliFMDQADataMakerRec: public AliQADataMakerRec {
-
- public:
+class AliFMDQADataMakerRec: public AliQADataMakerRec 
+{
+public:
   AliFMDQADataMakerRec();
-  AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) ;   
+  AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm);   
   virtual ~AliFMDQADataMakerRec() {}
-  
- private:
+private:
   virtual void   EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray * list);
   virtual void   InitESDs(); 
   virtual void   InitDigits(); 
@@ -40,7 +39,7 @@ class AliFMDQADataMakerRec: public AliQADataMakerRec {
 
   ClassDef(AliFMDQADataMakerRec,0)  // description 
 
-    };
+};
 
 #endif // AliFMDQADataMakerRec_H
 //____________________________________________________________________
index d34156a..1e8f9b2 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
+ * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved.      *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
 //_____________________________________________________________________
 
 ClassImp(AliFMDQADataMakerSim)
-           
+#if 0
+; // This line is for Emacs - do not delete!
+#endif
 //_____________________________________________________________________
-AliFMDQADataMakerSim::AliFMDQADataMakerSim() 
-AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD),
-                 "FMD Quality Assurance Data Maker")
+AliFMDQADataMakerSim::AliFMDQADataMakerSim() 
+  :  AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD),
+                      "FMD Quality Assurance Data Maker")
 {
   // ctor
   
 }
 
 //_____________________________________________________________________
-AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) :
-  AliQADataMakerSim()
+AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) 
+  AliQADataMakerSim()
 {
   //copy ctor 
   // Parameters: 
@@ -61,11 +63,15 @@ AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) :
 }
 
 //_____________________________________________________________________
-void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, 
+                                             TObjArray * list)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
-  AliLog::Message(5,"FMD: end of detector cycle","AliFMDQADataMakerSim","AliFMDQADataMakerSim","AliFMDQADataMakerSim::EndOfDetectorCycle","AliFMDQADataMakerSim.cxx",83);
+  AliLog::Message(5,"FMD: end of detector cycle",
+                 "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
+                 "AliFMDQADataMakerSim::EndOfDetectorCycle",
+                 "AliFMDQADataMakerSim.cxx",83);
   AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ;  
   
 }
@@ -74,7 +80,7 @@ void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray *
 void AliFMDQADataMakerSim::InitHits()
 {
   // create Digits histograms in Digits subdir
-  TH1F* hEnergyOfHits    = new TH1F("hEnergyOfHits","Energy distribution",100,0,3);
+  TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3);
   hEnergyOfHits->SetXTitle("Edep");
   hEnergyOfHits->SetYTitle("Counts");
   Add2HitsList(hEnergyOfHits, 0);
@@ -85,14 +91,8 @@ void AliFMDQADataMakerSim::InitDigits()
 {
   // create Digits histograms in Digits subdir
   TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024);
-  //TH1F* hEnergyOfDigits    = new TH1F("hEnergyOfDigits","Energy distribution",100,0,3);
   hADCCounts->SetXTitle("ADC counts");
-  //hADCCounts->SetYTitle("Counts");
-  //hEnergyOfDigits->SetXTitle("Edep/Emip");
-  //hEnergyOfDigits->SetYTitle("Counts");
   Add2DigitsList(hADCCounts, 0);
-  //Add2DigitsList(hEnergyOfDigits, 1);
-  
 }
 
 //_____________________________________________________________________
index 9ae182e..e7a57da 100644 (file)
@@ -1,51 +1,56 @@
-void MakeFMDFullMisAlignment(){
+void MakeFMDFullMisAlignment()
+{
   // Create TClonesArray of full misalignment objects for FMD
-  //
   const char* macroname = "MakeFMDFullMisAlignment.C";
 
   // Activate CDB storage and load geometry from CDB
   AliCDBManager* cdb = AliCDBManager::Instance();
   if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
   cdb->SetRun(0);
+
+  Bool_t  toCdb   = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+  TString storage = gSystem->Getenv("STORAGE");
   
-  TString Storage;
-  
-  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
-    Storage = gSystem->Getenv("STORAGE");
-    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
-      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+  if(toCdb) {
+    if(!storage.BeginsWith("local://") && 
+       !storage.BeginsWith("alien://")) {
+      Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
       return;
     }
-    AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
-    if(!storage){
-      Error(macroname,"Unable to open storage %s\n",Storage.Data());
+
+    AliCDBStorage* store = cdb->GetStorage(storage.Data());
+    if(!store){
+      Error(macroname,"Unable to open storage %s\n", storage.Data());
       return;
     }
-    AliCDBPath path("GRP","Geometry","Data");
-    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
+
+    AliCDBPath   path("GRP","Geometry","Data");
+    AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
     if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
+
     entry->SetOwner(0);
-    TGeoManager* geom = (TGeoManager*) entry->GetObject();
+    TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
     AliGeomManager::SetGeometry(geom);
-  }else{
-    AliGeomManager::LoadGeometry(); //load geom from default CDB storage
-  }    
+  }else
+    //load geom from default CDB storage
+    AliGeomManager::LoadGeometry(); 
   
   gSystem->Load("libFMDutil.so");
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
-    // save on file
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDfullMisalignment.root");
-  }else{
-    // save in CDB storage
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
-  }
-
-  // fRunMax should be changed in the constructor
-
-  faker.SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
-  faker.SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
-  faker.SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
-  faker.SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
-  faker.Exec();
+  AliFMDAlignFaker* faker = (toCdb ? 
+                            // save on file
+                            new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                 "geometry.root",
+                                                 "FMDfullMisalignment.root") :
+                            // save in CDB storage
+                            new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                 "geometry.root", 
+                                                 storage.Data()));
 
+  // Displacements and rotations
+  faker->SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
+  faker->SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
+  faker->SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
+  faker->SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
+  faker->Exec();
+  delete faker;
 }
index 1fb0081..bbf01b8 100644 (file)
@@ -8,46 +8,53 @@ void MakeFMDResMisAlignment()
   AliCDBManager* cdb = AliCDBManager::Instance();
   if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
   cdb->SetRun(0);
+
+  Bool_t  toCdb   = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+  TString storage = gSystem->Getenv("STORAGE");
   
-  TString Storage;
-  
-  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
-    Storage = gSystem->Getenv("STORAGE");
-    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
-      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+  if(toCdb) {
+    if(!storage.BeginsWith("local://") && 
+       !storage.BeginsWith("alien://")) {
+      Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
       return;
     }
-    AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
-    if(!storage){
-      Error(macroname,"Unable to open storage %s\n",Storage.Data());
+
+    AliCDBStorage* store = cdb->GetStorage(storage.Data());
+    if(!store){
+      Error(macroname,"Unable to open storage %s\n", storage.Data());
       return;
     }
-    AliCDBPath path("GRP","Geometry","Data");
-    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
+
+    AliCDBPath   path("GRP","Geometry","Data");
+    AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
     if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
+
     entry->SetOwner(0);
-    TGeoManager* geom = (TGeoManager*) entry->GetObject();
+    TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
     AliGeomManager::SetGeometry(geom);
-  }else{
-    AliGeomManager::LoadGeometry(); //load geom from default CDB storage
-  }    
+  }else
+    //load geom from default CDB storage
+    AliGeomManager::LoadGeometry(); 
   
   gSystem->Load("libFMDutil.so");
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
-    // save on file
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDresidualMisalignment.root");
-  }else{
-    // save in CDB storage
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
-  }
-
-  // fRunMax should be changed in the constructor
-
-  faker.SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
-  faker.SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
-  faker.SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
-  faker.SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
-  faker.Exec();
+  AliFMDAlignFaker* faker = (toCdb ? 
+                            // save on file
+                            new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                 "geometry.root",
+                                                 "FMDfullMisalignment.root") :
+                            // save in CDB storage
+                            new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                 "geometry.root", 
+                                                 storage.Data()));
 
+  faker->SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
+  faker->SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
+  faker->SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
+  faker->SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
+  faker->Exec();
+  delete faker;
 
 }
+//
+// EOF
+//
index b3048ed..1cba6e5 100644 (file)
@@ -8,46 +8,52 @@ void MakeFMDZeroMisAlignment()
   AliCDBManager* cdb = AliCDBManager::Instance();
   if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
   cdb->SetRun(0);
+
+  Bool_t  toCdb   = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+  TString storage = gSystem->Getenv("STORAGE");
   
-  TString Storage;
-  
-  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
-    Storage = gSystem->Getenv("STORAGE");
-    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
-      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+  if(toCdb) {
+    if(!storage.BeginsWith("local://") && 
+       !storage.BeginsWith("alien://")) {
+      Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
       return;
     }
-    AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
-    if(!storage){
-      Error(macroname,"Unable to open storage %s\n",Storage.Data());
+
+    AliCDBStorage* store = cdb->GetStorage(storage.Data());
+    if(!store){
+      Error(macroname,"Unable to open storage %s\n", storage.Data());
       return;
     }
-    AliCDBPath path("GRP","Geometry","Data");
-    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
+
+    AliCDBPath   path("GRP","Geometry","Data");
+    AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
     if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
+
     entry->SetOwner(0);
-    TGeoManager* geom = (TGeoManager*) entry->GetObject();
+    TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
     AliGeomManager::SetGeometry(geom);
-  }else{
-    AliGeomManager::LoadGeometry(); //load geom from default CDB storage
-  }    
+  }else
+    //load geom from default CDB storage
+    AliGeomManager::LoadGeometry(); 
   
   gSystem->Load("libFMDutil.so");
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
-    // save on file
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDAlignObjs.root");
-  }else{
-    // save in CDB storage
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
-  }
-
-  // fRunMax should be changed in the constructor
-
-  faker.SetSensorDisplacement(0., 0., 0., 0., 0., 0.);
-  faker.SetSensorRotation(0., 0., 0., 0., 0., 0.);
-  faker.SetHalfDisplacement(0., 0., 0., 0., 0., 0.);
-  faker.SetHalfRotation(0., 0., 0., 0., 0., 0.);
-  faker.Exec();
+  AliFMDAlignFaker* faker = (toCdb ? 
+                            // save on file
+                            new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                 "geometry.root",
+                                                 "FMDfullMisalignment.root") :
+                            // save in CDB storage
+                            new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                 "geometry.root", 
+                                                 storage.Data()));
+
+
+  faker->SetSensorDisplacement(0., 0., 0., 0., 0., 0.);
+  faker->SetSensorRotation(0., 0., 0., 0., 0., 0.);
+  faker->SetHalfDisplacement(0., 0., 0., 0., 0., 0.);
+  faker->SetHalfRotation(0., 0., 0., 0., 0., 0.);
+  faker->Exec();
+  delete faker;
 
 
 }