Exemplo n.º 1
0
Bool_t ChangeRunRange(const char* objectPath,
                      int run1=0, int run2=AliCDBRunRange::Infinity(),
                      const char* inputOCDB="alien://folder=/alice/data/2013/OCDB",
                      const char* outputOCDB="alien://folder=/alice/cern.ch/user/l/laphecet/OCDB2013") 
{
  AliCDBManager* man = AliCDBManager::Instance();
  
  man->SetDefaultStorage(inputOCDB);
  
  AliCDBEntry* e = man->Get(objectPath,AliCDBRunRange::Infinity());
  
  if (!e)
  {
    cout << Form("ERROR : could not get %s from %s",objectPath,inputOCDB) << endl;
    return kFALSE;
  }
  
  e->GetId().SetRunRange(run1,run2);
  
  AliCDBMetaData* md = e->GetMetaData();
  
  md->SetResponsible("L. Aphecetche and P. Pillot"); // to insure we have no $Id$ in the metadata fields (see https://savannah.cern.ch/bugs/?95527)
  
  man->SetDefaultStorage(outputOCDB);
 
  return man->Put(e->GetObject(),e->GetId(),e->GetMetaData());
}
Exemplo n.º 2
0
void PatchCDB(const char* runlist, const char* runlist1400, const char* srcOCDBPath="alien://folder=/alice/data/2016/OCDB", const char* destOCDBPath="alien://folder=/alice/cern.ch/user/l/laphecet/OCDBCH3L")
{
    // function to patch the OCDB MUON/Calib/HV for the swap of CH3L Q2S1 and Q2S2
    // runlist = full list of runs where Chamber03Left/Quad2Sect1 has an HV problem (trips, too low, plus the 1400 V
    // below)
    // runlist1400 = list of runs where Chamber03Left/Quad2Sect1 was struggling at 1400 V
    // for the runs in runlist1400, the HV will be forced to zero for that sector
    // note that Chamber03Left/Quad2Sect1 = Chamber02Left/Quad1Sect0 in DCS alias world
     
  AliAnalysisTriggerScalers ts(runlist,srcOCDBPath);

  std::vector<int> vrunlist = ts.GetRunList();

  AliAnalysisTriggerScalers ts1400(runlist1400,srcOCDBPath);
  std::vector<int> vrunlist1400 = ts1400.GetRunList();

  AliCDBManager* man = AliCDBManager::Instance();

  TObjString sector2("MchHvLvLeft/Chamber02Left/Quad1Sect0.actual.vMon");
  TObjString sector1("MchHvLvLeft/Chamber02Left/Quad1Sect1.actual.vMon");

  for ( auto r : vrunlist )
  {
      man->SetDefaultStorage(srcOCDBPath);
      man->SetRun(r);
      std::cout << "Run " << r << std::endl;

      AliCDBEntry* entry = man->Get("MUON/Calib/HV");
      TMap* hvmap = static_cast<TMap*>(entry->GetObject()->Clone());

      TPair* p1 = hvmap->RemoveEntry(&sector2);

      if ( std::find(vrunlist1400.begin(),vrunlist1400.end(),r) != vrunlist1400.end() )
      {
        TObjArray* a1 = static_cast<TObjArray*>(p1->Value());
        AliDCSValue* first = static_cast<AliDCSValue*>(a1->First());
        AliDCSValue* last = static_cast<AliDCSValue*>(a1->Last());
        a1->Delete();
        a1->Add(new AliDCSValue(0.0f,first->GetTimeStamp()));
        a1->Add(new AliDCSValue(0.0f,last->GetTimeStamp()));
      }
      TPair* p2 = hvmap->RemoveEntry(&sector1);

      hvmap->Add(new TObjString(sector2),p2->Value());
      hvmap->Add(new TObjString(sector1),p1->Value());

      delete p1->Key();
      delete p2->Key();

      man->SetDefaultStorage(destOCDBPath);
      hvmap->SetUniqueID( hvmap->GetUniqueID() | ( 1 << 9 ) );
      AliMUONCDB::WriteToCDB(hvmap,"MUON/Calib/HV",r,r,"Patched for CH3L Quad2Sect1 vs 0 swapping","L. Aphecetche");
      man->ClearCache();
  }
}
Exemplo n.º 3
0
void MakeLHCClockPhaseEntry(const char *cdbStorage = "local://$ALICE_ROOT/OCDB")
{
  // Example macro to put in OCDB the default (=0) LHC-clock phase
  // It is valid fro runs from 0 to inf
  // The timestamp range is also inf (we store the first and last value for
  // each beam)
  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorage(cdbStorage);

  AliLHCClockPhase phaseObj;

  phaseObj.AddPhaseB1DP(0,0.);
  phaseObj.AddPhaseB2DP(0,0.);

  phaseObj.AddPhaseB1DP(2147483647,0.);
  phaseObj.AddPhaseB2DP(2147483647,0.);

  AliCDBMetaData* metadata = new AliCDBMetaData();
  metadata->SetResponsible("Cvetan Cheshkov");
  metadata->SetComment("Default LHC-clock phase object");
  AliCDBId id("GRP/Calib/LHCClockPhase",0,AliCDBRunRange::Infinity());

  man->Put(&phaseObj,id,metadata);

  return;
}
Exemplo n.º 4
0
void MakeVZEROTimeDelaysEntry()
{

  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");

  // Creation of the time delays OCDB object
  const Double_t timeShift[66] = {0.0 , 0.477957 , 0.0889999 , 0.757669 , 0.205439 , 0.239666 , -0.183705 , 0.442873 , -0.281366 , 0.260976 , 0.788995 , 0.974758 , 0.548532 , 0.495023 , 0.868472 , 0.661167 , 0.358307 , 0.221243 , 0.530179 , 1.26696 , 1.33082 , 1.27086 , 1.77133 , 1.10253 , 0.634806+0.885 , 2.14838 , 1.50212 , 1.59253 , 1.66122+0.740 , 1.16957 , 1.52056 , 1.47791 , 1.81905 , -1.94123 , -1.29124-0.350 , -2.16045 , -1.78939 , -3.11111 , -1.87178 , -1.57671-0.560 , -1.70311 , -1.81208 , -1.94475 , -2.53058+0.930 , -1.7042 , -2.08109 , -1.84416 , -0.61073 , -1.77145 , 0.16999 , -0.0585339 , 0.00401133 , 0.397726 , 0.851111 , 0.264187 , 0.59573 , -0.158263 , 0.584362 , 1.20835 , 0.927573 , 1.13895 , 0.64648 , 2.18747 , 1.68909 , 0.451194 , 0.0};
  TH1F *delays = new TH1F("VZEROTimeDelays","VZERO Time delays",64,-0.5,63.5);
  delays->SetContent(timeShift);
	
  AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
  md->SetResponsible("Brigitte Cheynis");
  md->SetBeamPeriod(0);
  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  md->SetComment("Time delays channel by channel for year >= 2012");
  md->PrintMetaData();

  AliCDBId id("VZERO/Calib/TimeDelays",0,AliCDBRunRange::Infinity());

  man->Put(delays, id, md);

  delete md;

}
Exemplo n.º 5
0
void MakeADLightYieldsEntry(const char *outputCDB = "local://$ALICE_ROOT/../AliRoot/OCDB")
{

  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorage(outputCDB);

  // Creation of the light yields OCDB object
  const Double_t lightYieldCorr[18] = {0.0,
				       2.2e-4,2.2e-4,2.2e-4,2.2e-4, 2.2e-4,2.2e-4,2.2e-4,2.2e-4,
                                       2.4e-4,2.4e-4,2.6e-4,2.6e-4, 2.4e-4,2.4e-4,2.6e-4,2.6e-4,
				       0.0};

  TH1F *yields = new TH1F("ADLightYields", "AD Light Yields", 16, -0.5, 15.5);
  yields->SetContent(lightYieldCorr);

  AliCDBMetaData *md = new AliCDBMetaData(); // metaData describing the object
  md->SetResponsible("Michal Broz");
  md->SetBeamPeriod(0);
  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  md->SetComment("Light Yields channel by channel");
  md->PrintMetaData();

  AliCDBId id("AD/Calib/LightYields", 0, AliCDBRunRange::Infinity());
  man->Put(yields, id, md);

  delete md;

}
Exemplo n.º 6
0
void MakeADTimeDelaysEntry(const char *outputCDB = "local://$ALICE_ROOT/../AliRoot/OCDB")
{

  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorage(outputCDB);

  // Creation of the time delays OCDB object
  //const Double_t timeShift[18] = {0.0, 203.2, 203.4, 203.5, 203.0, 203.4, 203.5, 203.1, 203.2, 194.2, 194.4, 194.5, 194.2, 194.7, 194.5, 194.3, 192.8, 0.0};
  const Double_t timeShift[18] = {0.0, 61.6091, 61.1891, 60.5191, 61.3591, 60.7691, 62.0291, 61.1091, 61.4591, 62.3491, 62.7891, 59.7791, 60.0991, 63.3091, 62.7691, 59.6491, 61.5091, 0.0};
  TH1F *delays = new TH1F("ADTimeDelays", "AD Time delays", 16, -0.5, 15.5);
  delays->SetContent(timeShift);
	
  AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
  md->SetResponsible("Michal Broz");
  md->SetBeamPeriod(0);
  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  md->SetComment("Time delays channel by channel");
  md->PrintMetaData();

  AliCDBStorage *storLoc = man->GetDefaultStorage();
  AliCDBId id("AD/Calib/TimeDelays", 0, AliCDBRunRange::Infinity());

  man->Put(delays, id, md);

  delete md;

}
Exemplo n.º 7
0
void MakeFMDZeroMisAlignment()
{
  // Create TClonesArray of zero-misalignment objects for FMD
  //
  const char* macroname = "MakeFMDZeroMisAlignment.C";

  // Activate CDB storage and load geometry from CDB
  AliCDBManager* cdb = AliCDBManager::Instance();
  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  cdb->SetRun(0);

  Bool_t    toCdb   = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
  TString   storage = gSystem->Getenv("STORAGE");
  TString   output  = "FMDfullMisalignment.root";
  if(toCdb) output  = storage;
  
  gSystem->Load("libFMDutil");
  AliFMDAlignFaker::GetGeometry(toCdb, storage);
  AliFMDAlignFaker* faker = new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
						 "geometry.root", 
						 output.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;


}
Exemplo n.º 8
0
void rec() {
	//  AliLog::SetGlobalDebugLevel(10);
	AliCDBManager * man = AliCDBManager::Instance();
	man->SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-10-Release/Residual/");
	man->SetSpecificStorage("EMCAL/*","local://DB");
	
	AliReconstruction reco;
	AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
	AliTracker::SetFieldMap(field,kTRUE);
	reco.SetUniformFieldTracking(kFALSE);
	reco.SetWriteESDfriend();
	reco.SetWriteAlignmentData();
  
	AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam();
	AliTPCReconstructor::SetRecoParam(tpcRecoParam);
	AliTPCReconstructor::SetStreamLevel(0);
	reco.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS EMCAL MUON T0 VZERO FMD PMD ZDC");
	//reco.SetInput("raw.root") ;
	//AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();
//	recEmc->SetSubtractPedestals(kFALSE);
//	AliPHOSReconstructor::SetRecoParamEmc(recEmc);  
	reco.SetRunQA(kFALSE) ; 

	TStopwatch timer;
	timer.Start();
	reco.Run();
	timer.Stop();
	timer.Print();
}
Exemplo n.º 9
0
void
PrintAlignment()
{
  AliCDBManager* cdb   = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  AliCDBEntry*   align = cdb->Get("FMD/Align/Data");
  if (!align) {
    Error("PrintAlignment","didn't alignment data from CDB");
    return;
  }
  
  TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject());
  if (!array) {
    Warning("PrintAlignement", "Invalid align data from CDB");
    return;
  }
  Int_t nAlign = array->GetEntries();
  for (Int_t i = 0; i < nAlign; i++) {
    AliAlignObjParams* a = static_cast<AliAlignObjParams*>(array->At(i));
    Double_t ang[3];
    Double_t trans[3];
    a->GetAngles(ang);
    a->GetTranslation(trans);
    std::cout << a->GetVolPath() << "\n" 
	      << "  translation: "
	      << "(" << std::setw(12) << trans[0] 
	      << "," << std::setw(12) << trans[1] 
	      << "," << std::setw(12) << trans[2] << ")\n"
	      << "  rotation:    "
	      << "(" << std::setw(12) << ang[0] 
	      << "," << std::setw(12) << ang[1] 
	      << "," << std::setw(12) << ang[2]  << ")" << std::endl;
    // a->Print();
  }
}
Exemplo n.º 10
0
//-----------------------------------------------------------------------
void MakeMUONRecoParamArray(Int_t startRun = 0, 
                            Int_t endRun = AliCDBRunRange::Infinity(),
                            const char* settings="ppIdeal")
{
  /// set the reconstruction parameters and store them in the OCDB ($ALICE_ROOT/OCDB/MUON/Calib/RecoParam/).
  ///
  /// - make a CDB entry for the run range [startRun, endRun]
  ///
  /// for the possible values of settings, please see AliMUONRecoParam::Create
  
  // init CDB
  AliCDBManager* man = AliCDBManager::Instance();
  
  if (!man->IsDefaultStorageSet()) 
  {
    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");    
  }
  
  man->SetRun(startRun);
  
  TObjArray* recoParams = AliMUONRecoParam::Create(settings);
  
  if (recoParams)
  {
    // save RecoParam in CDB
    AliMUONCDB::WriteToCDB(recoParams, "MUON/Calib/RecoParam", startRun, endRun, 
                           "reconstruction parameters for MUON", "L. Aphecetche and P. Pillot");
  }
  
  delete recoParams;
}
Exemplo n.º 11
0
void MakeVZEROTimeDelaysEntryRun2()
{

  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorage("local://./OCDB");

  // Creation of the time delays OCDB object

  const Double_t timeShift[66] = {0.0 , 263.453366 , 263.554201 , 263.455896 , 263.705908 , 263.178068 , 263.260511 , 263.352692 , 263.371615 , 264.275609 , 263.022590 , 263.923256 , 263.477724 , 263.328535 , 263.338143 , 263.684347 , 263.636735 , 264.240256 , 264.704787 , 263.341181 , 265.875077 , 264.362158 , 264.009584 , 263.985062 , 264.507631 , 264.711630 , 264.702209 , 264.983539 , 265.156149 , 265.340929 , 265.185957 , 265.402229 , 267.060006 , 260.193899 , 260.831277 , 260.870380 , 260.231921 , 259.848971 , 263.069287 , 262.829099 , 261.297212 , 260.468547 , 260.962657 , 260.754787 , 260.782074 , 260.244392 , 263.248285 , 262.224661 , 259.936356 , 262.307604 , 262.698634 , 262.259535 , 262.425491 , 262.041006 , 264.711811 , 264.537483 , 262.019158 , 263.940932 , 263.309260 , 263.819921 , 264.324985 , 263.419804 , 265.954522 , 266.150658 , 263.942502 , 0.0};
  TH1F *delays = new TH1F("VZEROTimeDelays","VZERO Time delays",64,-0.5,63.5);
  delays->SetContent(timeShift);
	
  AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
  md->SetResponsible("Brigitte Cheynis");
  md->SetBeamPeriod(0);
  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  md->SetComment("Time delays channel by channel for Run2");
  md->PrintMetaData();

  AliCDBId id("VZERO/Calib/TimeDelays",215011,AliCDBRunRange::Infinity());

  man->Put(delays, id, md);

  delete md;

}
void CreateOnlineCalibPars_CalibHisto(){
  // Create TOF Calibration Object from AliTOFcalibHisto class
  // and write it on CDB

  AliTOFcalib *tofcalib = new AliTOFcalib();
  tofcalib->CreateCalArrays();
  AliTOFChannelOnlineArray *delayArray = (AliTOFChannelOnlineArray*) tofcalib->GetTOFOnlineDelay();

  /* get calib histo andl and load params */
  AliTOFcalibHisto calibHisto;
  calibHisto.LoadCalibPar();

  /* turn time-slewing correction off to only retrieve constants */
  calibHisto.SetFullCorrectionFlag(AliTOFcalibHisto::kTimeSlewingCorr, kFALSE);

  /* OCDB init */
  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  Int_t nChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
  
  /* channel-related params */
  Double_t delay;
  for (Int_t ipad = 0 ; ipad<nChannels; ipad++){
    AliTOFChannelOnline *calChannelOnline = (AliTOFChannelOnline *)tofCalOnline->At(ipad);
    delay = calibHisto.GetFullCorrection(ipad);
    delayArray->SetDelay(ipad, delay);
  }

  /* write */
  tofcalib->WriteParOnlineDelayOnCDB("TOF/Calib",0,AliCDBRunRange::Infinity());
}
Exemplo n.º 13
0
void OCDBDefault(Int_t mode)
{

  Int_t run  = atoi(gSystem->Getenv("CONFIG_RUN"));  
  AliCDBManager* man = AliCDBManager::Instance();
  man->SetDefaultStorage("raw://");
  
  if(gSystem->Getenv("CONFIG_OCDBTIMESTAMP"))
  {
    TString t = gSystem->Getenv("CONFIG_OCDBTIMESTAMP");
    TObjArray* list =t.Tokenize("_");
    UInt_t tU[6];
    for(Int_t i=0; i<list->GetEntries(); i++)
    {
      TString st = ((TObjString*)list->At(i))->GetString();
      tU[i] =(UInt_t)atoi(st.Data());
    }
    man->SetMaxDate(TTimeStamp(tU[0], tU[1], tU[2], tU[3], tU[4], tU[5]));
    printf("*** Setting custom OCDB time stamp %s ***\n", t.Data());
  }
  
  man->SetRun(run);
  
  // set detector specific paths
  DefaultSpecificStorage(man, mode);

}
Exemplo n.º 14
0
MakeCDBEntryTriggerMask(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
{

  UInt_t triggerMask[72];
  for (Int_t i = 0; i < 72; i++)
    triggerMask[i] = 0xffffff;

  /* create object */
  AliTOFTriggerMask *obj = new AliTOFTriggerMask();
  obj->SetTriggerMaskArray(triggerMask);

  /* create cdb info */
  AliCDBId id("TRIGGER/TOF/TriggerMask", startRun, endRun);
  AliCDBMetaData *md = new AliCDBMetaData();
  md->SetResponsible("Roberto Preghenella");
  md->SetComment("TOF Trigger Mask");
  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  md->SetBeamPeriod(0);

  /* put object in cdb */
  AliCDBManager *cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  cdb->GetDefaultStorage()->Put(obj, id, md);

}
Exemplo n.º 15
0
void runReconstruction(int seed, const char* input, const char* recoptions, bool rawocdb)
{ 
  AliCDBManager* man = AliCDBManager::Instance();
  
  if ( rawocdb ) 
  {
    cout << "**** WILL USE RAW OCDB" << endl;
    man->SetDefaultStorage("raw://"); //alien://folder=/alice/data/2011/OCDB?cacheFold=/Users/laurent/OCDBcache");
    man->SetSpecificStorage("ITS/Calib/RecoParam","alien://folder=/alice/cern.ch/user/p/ppillot/OCDB_PbPbSim");
  } 
  else
  {
    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");

    man->SetSpecificStorage("GRP/GRP/Data",
                            Form("local://%s",gSystem->pwd()));

  }
  
  gRandom->SetSeed(seed);
  
  AliReconstruction* MuonRec = new AliReconstruction("galice.root");
  MuonRec->SetInput(gSystem->ExpandPathName(input));
  MuonRec->SetRunReconstruction("MUON ITS");
  MuonRec->SetFillESD("HLT");
  MuonRec->SetOption("HLT", "libAliHLTMUON.so");
  MuonRec->SetNumberOfEventsPerFile(10000);
  MuonRec->SetOption("MUON",recoptions);
  MuonRec->SetRunQA("MUON:ALL");
  MuonRec->SetQAWriteExpert(AliQAv1::kMUON);
  MuonRec->SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
  MuonRec->SetWriteESDfriend(kFALSE);
  MuonRec->SetCleanESD(kFALSE);  
  MuonRec->SetStopOnError(kFALSE);
  
  // uncomment the following lines if you want to set custom RecoParam
  // instead of getting them from the OCDB
  //  AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
  //  muonRecoParam->SaveFullClusterInESD(kTRUE,100.);
  //  MuonRec->SetRecoParam("MUON",muonRecoParam);
  
  MuonRec->Run();
  
  delete MuonRec;
  
  //gObjectTable->Print();
}
Exemplo n.º 16
0
void initGeom()
{
    // Macro replacing the gAlice->Init() to initialize the geometry
    // Suggested by Raffaele Grosso <*****@*****.**>
    
    AliCDBManager* man = AliCDBManager::Instance();
    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
    man->SetRun(0);
    
    gROOT->LoadMacro("Config.C");
    gInterpreter->ProcessLine(gAlice->GetConfigFunction());
    gAlice->GetMCApp()->Init();
}
Exemplo n.º 17
0
AliTOFTriggerMask *
ReadCDBEntryTriggerMask(Int_t run, const Char_t *defaultStorage = "raw://", const Char_t *specificStorage = NULL)
{
  AliCDBManager *cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage(defaultStorage);
  if (specificStorage)
    cdb->SetSpecificStorage("TRIGGER/TOF/TriggerMask", specificStorage);
  cdb->SetRun(run);
  AliCDBEntry *cdbe = cdb->Get("TRIGGER/TOF/TriggerMask");
  AliTOFTriggerMask *triggerMaskObj = (AliTOFTriggerMask *)cdbe->GetObject();

  return triggerMaskObj;
}
Exemplo n.º 18
0
void MakeQAThresholdsEntry(const char* storageUri="local://$ALICE_ROOT/../AliRoot/OCDB", Int_t firstRun=0, Int_t lastRun=999999999)
{
  AliCDBManager *cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage(storageUri);
  // QAThresholds
  TObjArray* qaThrArray = new TObjArray();
  for (Int_t idet = 0; idet < AliDAQ::kNDetectors; idet++){
    TString detName = AliDAQ::OnlineName(idet);
    if (detName == "TRI" || detName == "HLT" || detName == "TST") continue;   // skipping TRI, HLT, TST since they do not produce QAThresholds
    Printf("Processing QAThreshold for detector %s",detName.Data()); 
    TString inFile(gSystem->ExpandPathName("$ALICE_ROOT/../AliRoot/GRP/ShuttleInput/"));
    inFile += "run000168322_";
    inFile += detName;
    inFile += "_DQM_QAThresholds";
    Printf("Opening QAThreshold file %s", inFile.Data());
    TFile dqmFile(inFile.Data(),"READ");
    if (dqmFile.IsOpen()) {
      AliQAThresholds* qaThr = dynamic_cast<AliQAThresholds*>(dqmFile.Get(detName.Data()));
      if (qaThr){
        Int_t qaThrId = qaThr->GetDetectorId();
        if (qaThrId != idet){
          Printf("ERROR: Expecting QA threshold for detector %s, but found that for detector %s, skipping",detName.Data(), AliDAQ::OnlineName(qaThrId));
          continue;
        }
        else{
          qaThrArray->AddAtAndExpand(qaThr, qaThrId);
        }
      }
      else {
        Printf("ERROR: No QAThresholds object found in the file for detector %s, skipping",detName.Data());
        continue;
      }
    }
    else {
      Printf("ERROR: Can't open QAThreshold file for detector %s, skipping",detName.Data());
      continue;					
    }
  }
  if (qaThrArray->GetEntries() > 0){
    AliCDBMetaData md;
    md.SetResponsible("Barthélémy von Haller");
    md.SetComment("QA Threshold TObjArray");
    AliCDBId id("GRP/Calib/QAThresholds", firstRun, lastRun);
    cdb->Put(qaThrArray, id, &md); 
  }
  else{
    Printf("No valid QAThresholds entries found, storing nothing in the OCDB");
  }

}
Exemplo n.º 19
0
//__________________________________________________________
void AliTRDCheckPedestal(const Int_t runNr){
  // Establish grid connection
  if(!TGrid::Connect("alien://")){printf("F-No grid connection\n");return;}
  // Set the storage to the OCDB of this runNr. It will be like
  // alien://folder=/alice/data/2016/OCDB
  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorageFromRun(runNr);
  // We derive the reference storage from it
  const AliCDBStorage *stor =  man->GetDefaultStorage();
  TString folder = stor->GetBaseFolder();
  folder.ReplaceAll("OCDB","Reference");
  man->SetDefaultStorage(Form("alien://folder=%s",folder.Data()));
  // Set the run number
  man->SetRun(runNr);

  // We abuse the folder name to derive the year
  TString yearString(folder);
  yearString.ReplaceAll("/alice/data/","");
  yearString.ReplaceAll("/Reference/","");
  const Int_t year = yearString.Atoi();
  printf("W-Experimental: Derived year %d from storage folder\n",year);
  
  // The reference data is stored per Local Data Concentrator
  std::vector<Int_t> LDCvec = GetLDCVector(year);
  // Loop over LDCs
  for(std::vector<Int_t>::iterator LDCit = LDCvec.begin();LDCit!=LDCvec.end();LDCit++){
    const TString padstatus = Form("TRD/DAQData/PadStatus%d",*LDCit);
    AliCDBEntry *entry = AliCDBManager::Instance()->Get(padstatus.Data());
    AliTRDCalibPadStatus *calpadstatus = dynamic_cast<AliTRDCalibPadStatus *>(entry->GetObject());
    if(!calpadstatus){printf("E-Can not find %s in %s \n",padstatus.Data(),folder.Data());continue;}

    //Create the noise pad with the RMS values of each channel
    AliTRDCalPad *noisePad = calpadstatus->CreateCalPad();
    // LDC -> SM mapping
    std::vector<Int_t> SMvec = GetSMVector(year,*LDCit);
    for(std::vector<Int_t>::iterator SMit=SMvec.begin();SMit!=SMvec.end();SMit++){
      const TString padstatussm = Form("PadNoise-LDC%d-SM%02d",*LDCit,*SMit);
      TCanvas *cpadstatusm = new TCanvas(padstatussm.Data(),padstatussm.Data(),50,50,600,800);
      cpadstatusm->Divide(3,2);
      // Draw each layer (or here plane)
      const Float_t zRange[2]={0.,0.2};
      for(Int_t iLayer = 0;iLayer<6;iLayer++){
  	cpadstatusm->cd(iLayer+1);
	noisePad->MakeHisto2DSmPl(*SMit,iLayer,0,0,zRange[0],zRange[1],-1)->Draw("colz");
      }
      cpadstatusm->SaveAs(Form("%s.pdf",cpadstatusm->GetName()));
    } // Loop over SMs of this LDC
  } // End of loop over LDCs
} // End of void AliTRDcheckPedestal
Exemplo n.º 20
0
void rec(const char *filename="raw.root")
{
  /////////////////////////////////////////////////////////////////////////////////////////
  //
  // Reconstruction script for 2011 RAW data - muon fast reco
  //
  /////////////////////////////////////////////////////////////////////////////////////////



  // Set the CDB storage location
  AliCDBManager * man = AliCDBManager::Instance();
  man->SetDefaultStorage("alien://folder=/alice/data/2011/OCDB");

  AliReconstruction rec;

  // Generate or use the local OCDB.root file
	//  rec.SetFromCDBSnapshot("OCDB.root");

  // Set reconstruction flags (skip detectors here if neded with -<detector name>
	//  rec.SetRunReconstruction("MUON ITS VZERO ZDC T0");
	rec.SetRunReconstruction("MUON ITS");

  // QA options
  rec.SetRunQA("Global MUON:ALL") ;
  rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;

  // MUON only reco - recoparameters
  rec.SetRecoParam("ITS",GetSpecialITSRecoParam());

  // AliReconstruction settings
  rec.SetWriteESDfriend(kTRUE);
  rec.SetWriteAlignmentData();
//  rec.SetInput(filename);
  rec.SetUseTrackingErrorsForAlignment("ITS");

  // switch off cleanESD
  rec.SetCleanESD(kFALSE);

  // Specific reco params for ZDC (why isn't this automatic?)
	//  rec.SetRecoParam("ZDC",AliZDCRecoParamPbPb::GetHighFluxParam(2760));

  //Ignore SetStopOnError
  rec.SetStopOnError(kFALSE);

  AliLog::Flush();
  rec.Run();

}
Exemplo n.º 21
0
void makeSDigit(Int_t run=117048,
                const char *fname="/alice/data/2010/LHC10b/000117048/raw/10000117048041.30.root")
{
  AliSimulation sim;
  //AliLog::SetGlobalDebugLevel(1);
  AliLog::SetModuleDebugLevel("STEER",1);
  AliCDBManager *cdbm = AliCDBManager::Instance();
  cdbm->SetRun(run);
  cdbm->SetDefaultStorage("local://$ALIROOT_OCDB_ROOT/OCDB");     
  //cdbm->SetDefaultStorage("raw://");     
  cdbm->SetSpecificStorage("GRP/GRP/Data",Form("local://%s","$ALICE_ROOT/test/rawmerge"));  
  sim.SetMakeSDigits("ITS TPC");
  sim.SetNumberOfEvents(10000);
  sim.ConvertRaw2SDigits(fname);
  return;
}
Exemplo n.º 22
0
/** Display hits 
    @ingroup FMD_script
 */
void
PatternRaw(const char* file="raw.root")
{
  // AliLog::SetModuleDebugLevel("FMD", 8);
  AliCDBManager* cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  cdb->SetRun(0);
  AliFMDParameters::Instance()->Init();
  gSystem->Load("libFMDutil");
  AliFMDPattern* d = new AliFMDPattern;
  d->AddLoad(AliFMDInput::kRaw);
  d->SetRawFile(file);
  d->SetName("raw");
  d->SetTitle("Raw");
  // d->AddLoad(AliFMDInput::kKinematics);
  d->Run();
}
Exemplo n.º 23
0
void DBStorageCalib(){

AliCDBManager *man = AliCDBManager::Instance();

AliCDBStorage *storLoc;
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");


AliADCalibData *calibda = new AliADCalibData("Calib");

Float_t Efficiencies[16] = { 
  0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
  0.94, 0.94, 0.94, 0.94, 0.94, 0.94
};
Float_t Rates[16] = {

  1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
  1.14, 0.94, 0.94, 0.94, 0.94, 0.94


                    };
  
calibda->SetEfficiencies(Efficiencies);
calibda->SetRates(Rates);

// Creation of the object AD Calibration as a MetaData
        
TObjString str("AD Calibration");      // object that will be stored

AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object

AliCDBId id("AD/Calib/Data",0,9999999);

md->SetResponsible("Mario Rodriguez Cahuantzi");
md->SetBeamPeriod(0);
md->SetAliRootVersion("v5-04-Rev-08");
md->SetComment("Prototype");
md->PrintMetaData();

storLoc = man->GetDefaultStorage();
storLoc->Put(calibda, id, md);

storLoc->Delete();
delete md;

}
Exemplo n.º 24
0
Arquivo: sim.C Projeto: ktf/AliRoot
void sim(Int_t embrun) 
{
  AliSimulation sim;
  if (embrun == 4) {
    AliCDBManager *cdbm = AliCDBManager::Instance();
    cdbm->SetRun(atoi(gSystem->Getenv("DC_RUN")));
    cdbm->SetDefaultStorage("local://$ALICE_ROOT/OCDB");     
    cdbm->SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd()));
    sim.SetMakeSDigits("ITS TPC TRD TOF VZERO");  

    sim.ConvertRaw2SDigits("raw.root","AliESDs.root");
    return;
  }
  
  if (embrun == 2) {
    sim.SetRunGeneration(kFALSE);
    sim.SetMakeSDigits("");
    sim.SetMakeDigitsFromHits("");
  }
  else {
    sim.SetRunGeneration(kTRUE);
    sim.SetMakeSDigits("ITS TPC TRD TOF VZERO");
  }
  sim.SetRunSimulation(kTRUE);
  sim.SetMakeDigits("ITS TPC TRD TOF VZERO");
  sim.SetWriteRawData("ITS TPC TRD TOF VZERO","raw.root",kTRUE);
  if (embrun == 1)
    sim.MergeWith("../BackgroundSDigits/galice.root",1);

  sim.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  sim.SetSpecificStorage("GRP/GRP/Data",
			       Form("local://%s",gSystem->pwd()));
  sim.SetRunQA(":") ; 
  AliQA::SetQARefStorage("local://$ALICE_ROOT/OCDB") ;
  
  for (Int_t det = 0 ; det < AliQA::kNDET ; det++) {
    sim.SetQACycles(det, 1) ;
  }

//   sim.SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-15-Release/Full/");
//   sim.SetRunHLT("");
//   sim.SetQA(kFALSE);

  sim.Run(1);
}
Exemplo n.º 25
0
void Init()
{  
  AliCDBManager* man = AliCDBManager::Instance();
  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  man->SetRun(0);
 
  // MC application initialization
  TString configFileName = "$ALICE_ROOT/macros/g4Config.C";
  gROOT->LoadMacro(configFileName.Data());
  gInterpreter->ProcessLine(gAlice->GetConfigFunction());
  gAlice->GetMCApp()->Init();

  ((TGeant4*)gMC)->ProcessGeantCommand("/mcDet/printMedia");

  cout << endl
       << "Only MonteCarlo initialization has been performed. " << endl
       << "To run simulation you have to re-run aliroot and choose Run in g4menu." << endl;
}    
Exemplo n.º 26
0
void recqa()
{
	const char * kYear = "08" ; 
 	gEnv->SetValue("Root.Stacktrace","no");
	gEnv->SetValue("Root.Stacktrace","no");
	AliCDBManager * man = AliCDBManager::Instance();
	//man->SetDefaultStorage("alien://Folder=/alice/data/2008/LHC08d/OCDB/") ; 
	man->SetDefaultStorage("local://$ALIROOT_OCDB_ROOT/OCDB");
  man.SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd()));
	TString detectors("ITS TPC TRD TOF PHOS HMPID EMCAL/*MUON*/ FMD ZDC PMD T0 VZERO");
	
	//AliQA::SetQARefStorage(Form("%s%s/", AliQA::GetQARefDefaultStorage(), kYear)) ;
	AliQA::SetQARefStorage("local://$ALIROOT_OCDB_ROOT/OCDB") ;
	//AliQA::SetQARefDataDirName(AliQA::kMONTECARLO) ; //RUN_TYPE
   
  AliQADataMamanager qas("rec") ; 
  qas.Run(detectors.Data(), AliQA::kRECPOINTS);
}
Exemplo n.º 27
0
/**************************************************************************
	
	Macro created for storing the OCDB Config Rates data of
	ACORDE in $ALICE_ROOT/OCDB/ACORDE/Config/Rates

	From: 

		Mario Rodriguez Cahuantzi <*****@*****.**>
		FCFM, BUAP, Puebla, Mexico

	Created:

		March 3rd. 2009 @ CERN


	Further commnents:

		Arturo Fernandez <*****@*****.**>

**************************************************************************/
void MakeACORDEOCDBConfigRate()
{

	AliCDBManager *man = AliCDBManager::Instance();

	AliCDBStorage *storLoc;
	man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");


	AliACORDECalibData *calibda = new AliACORDECalibData("OCDBConfgRates");

        Float_t Rates[60] = 
        {
                1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
                1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
                1.14, 0.94, 0.94, 0.94, 0.94, 1.94, 0.94, 0.94, 0.94, 0.94,
                1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
                1.94, 0.94, 0.94, 0.94, 1.94, 0.94, 0.94, 0.94, 0.94, 0.94,
                0.94, 0.94, 0.94, 0.94, 1.94, 0.94, 0.94, 0.94, 0.94, 0.94
        };

	calibda->SetRates(Rates);
	
	// Creation of the object ACORDE Calibration as a MetaData
        
	TObjString str("ACORDE OCDB Reference Config Rates Data");      // object that will be stored

	AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object

	AliCDBId id("ACORDE/Config/Rates",0,9999999);

	md->SetResponsible("Mario Rodriguez");
	md->SetBeamPeriod(0);
	md->SetAliRootVersion("Current trunk version");
	md->SetComment("Version 1.0 of OCDB Reference Config Data for ACORDE");
	md->PrintMetaData();

	storLoc = man->GetDefaultStorage();
	storLoc->Put(calibda, id, md);

	storLoc->Delete();
	delete md;

}
Exemplo n.º 28
0
void trd_qaRec()
{
  gSystem->Load("libANALYSIS");
  gSystem->Load("libTender");
  gSystem->Load("libPWGPP");

  if(!TFile::Open("TRD.DebugInfoGen.root")){
    printf("No debug file for InfoGen task.\n");
    return;
  }
  TTree *t = (TTree*)gFile->Get("trackInfo");
  AliTRDtrackInfo *fTrackInfo = 0x0;
  t->SetBranchAddress("TrackInfo.", &fTrackInfo);
  gROOT->cd();

  AliCDBManager *cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  cdb->SetRun(0);
  AliEveEventManager::Instance()->AssertGeometry();
  AliEveEventManager::AssertMagField();

  AliTRDReconstructor *reco = new AliTRDReconstructor();
  reco->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());

  AliEveTRDTrackList *tracks = new AliEveTRDTrackList("TRD QA Tracks");



  AliTRDtrackV1 *fTrack = 0x0, *track = 0x0;
  for (Int_t it=0; it<t->GetEntries(); it++){
    if(!t->GetEntry(it)) continue;
    if(!fTrackInfo) continue;
    if(!(fTrack = fTrackInfo->GetTrack())) continue;
    
    track = new AliTRDtrackV1(*fTrack);
    track->SetOwner();
    track->SetReconstructor(reco);
    tracks->AddElement(new AliEveTRDTrack(track));
    printf("Trk[%3d] ESD[%d] Ncls[%d]\n", it, fTrackInfo->GetESDinfo()->GetId(), fTrack->GetNumberOfClusters());
    if(it>= 100) break;
  }
  gEve->AddElement(tracks);
  gEve->Redraw3D();
}
Exemplo n.º 29
0
void recTPC(Int_t type, const char *filename="data.root")
{
  /// Set path to calibration data
  ///
  /// type variable = 0 - cosmic test
  ///               = 1 - laser test

  AliCDBManager * man = AliCDBManager::Instance();
  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  //man->SetRun(0);
  //man->SetSpecificStorage("TPC/*/*","local:///afs/cern.ch/user/m/mivanov/public/Calib");
  //
  // Set reconstruction parameters
  //
  AliLog::SetClassDebugLevel("AliTPCclusterer",2);
  AliTPCRecoParam * tpcRecoParam = 0;
  if (type==0)  tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
  if (type>0)  tpcRecoParam = AliTPCRecoParam::GetLaserTestParam(kTRUE);
  tpcRecoParam->Dump();
  AliTPCReconstructor::SetRecoParam(tpcRecoParam);
  AliTPCReconstructor::SetStreamLevel(1);
  //
  //
  //
  AliReconstruction rec;  
  rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  rec.SetSpecificStorage("TPC/*/*","local:///afs/cern.ch/user/m/mivanov/public/Calib");
  rec.SetLoadAlignData("");
  rec.SetWriteESDfriend(kTRUE);
  rec.SetInput(filename);
  rec.SetEquipmentIdMap("EquipmentIdMap.data");
  rec.SetRunReconstruction("TPC");
  rec.SetOption("TPC","PedestalSubtraction");
  //  rec.SetRunLocalReconstruction("");
  //  rec.SetRunTracking("TPC");
  rec.SetFillESD("TPC");
  rec.SetFillTriggerESD(kFALSE);
  rec.SetRunVertexFinder(kFALSE);
  rec.SetWriteAlignmentData(kTRUE);
  rec.Run();
}
Exemplo n.º 30
0
MakeCDBEntryCTPLatency(Float_t value = 0., Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
{

  /* create object */
  AliTOFCTPLatency *obj = new AliTOFCTPLatency();
  obj->SetCTPLatency(value);

  /* create cdb info */
  AliCDBId id("TOF/Calib/CTPLatency", startRun, endRun);
  AliCDBMetaData *md = new AliCDBMetaData();
  md->SetResponsible("Roberto Preghenella");
  md->SetComment("CTPLatency (ps)");
  md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  md->SetBeamPeriod(0);

  /* put object in cdb */
  AliCDBManager *cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  cdb->GetDefaultStorage()->Put(obj, id, md);

}