Exemplo n.º 1
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.º 2
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.º 3
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.º 4
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.º 5
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.º 6
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);

}
Exemplo n.º 7
0
///
/// Main method
///
/// \param year: year to set geometry and run range
/// \param printAll: verbosity checks 
///
void SetOCDBFromRun1(Int_t year = 2010, Bool_t printAll = kFALSE)
{  
  TGrid::Connect("alien://");
  
  Int_t run = 182325; //2012
  if(year == 2010) run = 134908;
  if(year == 2011) run = 159582;
  
  AliCDBManager* man = AliCDBManager::Instance();
  man->SetDefaultStorage("raw://");
  man->SetRun(run);
  AliCDBStorage *storage = man->GetDefaultStorage();
  
  // Instantiate EMCAL geometry for the first time
  AliEMCALGeometry * geom;
  if     (year == 2010) geom = AliEMCALGeometry::GetInstance("EMCAL_FIRSTYEARV1"); // 2010
  else                  geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");  // 2011-2012-2013
//else                  geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_8SM"); // Run2

  const Int_t nSM = geom->GetNumberOfSuperModules();
  
  // Get the final OCDB object
  
  AliEMCALCalibData* cparam = (AliEMCALCalibData*) (storage->Get("EMCAL/Calib/Data", run)->GetObject());

  // Access OCDB file with the first version of the calibration
  TString        first = "Run177115_999999999_v2_s0.root";
  if(year==2010) first = "Run113461_999999999_v3_s0.root";
  if(year==2011) first = "Run144484_999999999_v3_s0.root";
  
  TFile * f = TFile::Open(Form("alien:///alice/data/%d/OCDB/EMCAL/Calib/Data/%s",year,first.Data()),"READ");
  AliCDBEntry * cdb = (AliCDBEntry*) f->Get("AliCDBEntry");
  AliEMCALCalibData* cparam1 = (AliEMCALCalibData*)  cdb->GetObject();
  
  // New OCDB container
  AliEMCALCalibData *cparamnew=new AliEMCALCalibData("EMCAL");
  
  // Do the comparison
  Float_t param  = -1;
  Float_t param1 = -1;
  Int_t iCol = -1, iRow = -1, iSM =-1, iMod = -1,iIphi =-1,iIeta = -1;
  for(Int_t i=0;i < nSM*24*48; i++)
  {
    //printf("AbsID %d\n",i);
    geom->GetCellIndex(i,iSM,iMod,iIphi,iIeta);
    geom->GetCellPhiEtaIndexInSModule(iSM,iMod, iIphi, iIeta,iRow,iCol);
    
    Float_t param = -1;
    if( cparam  ) param  = cparam ->GetADCchannel(iSM,iCol,iRow);
    
    Float_t param1 = -1;
    if( cparam1 ) param1 = cparam1->GetADCchannel(iSM,iCol,iRow);
    
    if    (printAll)
      printf("ID %d, col %d, row %d, sm %d  final %1.4f, first %1.4f\n",
             i,iCol,iRow,iSM,param, param1);
    cparamnew->SetADCchannel      (iSM,iCol,iRow,param );
    cparamnew->SetADCchannelOnline(iSM,iCol,iRow,param1);
  }
  
  // Create OCDB File
  AliCDBMetaData md;
  md.SetComment("Calibration after calibration with pi0, store also first online calibration");
  md.SetBeamPeriod(0);
  md.SetResponsible("Gustavo Conesa");
  md.SetAliRootVersion(gSystem->Getenv("ARVERSION"));
  
  // Careful, select here the first run where this calibration is valid
  Int_t            firstRun = 172439; // 2012-13
  if(year == 2010) firstRun = 113461;
  if(year == 2011) firstRun = 144484;
  
  AliCDBId id("EMCAL/Calib/Data",firstRun,AliCDBRunRange::Infinity()); // create in EMCAL/Calib/Data DBFolder
  
  AliCDBManager* man2 = AliCDBManager::Instance();
  AliCDBStorage* loc = man2->GetStorage(Form("local://%d",year));
  loc->Put(cparamnew, id, &md);
}
Exemplo n.º 8
0
//______________________________________________________________________________
void CopyCDB(Int_t runnr, const char* fromURI, const char* toURI)
{
  TString allowedObjects;

//  allowedObjects += " HLT/ConfigMUON/DecisionComponent";
//  allowedObjects += " HLT/ConfigMUON/FieldIntegrals";
//  allowedObjects += " HLT/ConfigMUON/HitReconstructor";
//  allowedObjects += " HLT/ConfigMUON/MansoTrackerFSM";
//  allowedObjects += " HLT/ConfigMUON/TriggerReconstructor";
  
  /*
   
  allowedObjects += " GRP/Geometry/Data";
  allowedObjects += " GRP/CTP/Config";
  allowedObjects += " GRP/GRP/LHCData";
  allowedObjects += " GRP/CTP/Scalers";
  allowedObjects += " GRP/GRP/Data";
  allowedObjects += " GRP/Calib/MeanVertexSPD";
  allowedObjects += " GRP/CTP/Aliases";

  allowedObjects += " MUON/Calib/GlobalTriggerCrateConfig";
  allowedObjects += " MUON/Calib/LocalTriggerBoardMasks";
  allowedObjects += " MUON/Calib/MappingData";
  allowedObjects += " MUON/Calib/RegionalTriggerConfig";
  allowedObjects += " MUON/Calib/TriggerLut";
   
  allowedObjects += " MUON/Calib/Config";
  allowedObjects += " MUON/Calib/Gains";
  allowedObjects += " MUON/Calib/GlobalTriggerCrateConfig";
  allowedObjects += " MUON/Calib/HV";
  allowedObjects += " MUON/Calib/LocalTriggerBoardMasks";
  allowedObjects += " MUON/Calib/MappingRunData";
  allowedObjects += " MUON/Calib/Neighbours";
  allowedObjects += " MUON/Calib/OccupancyMap";
  allowedObjects += " MUON/Calib/Pedestals";
  allowedObjects += " MUON/Calib/RecoParam";
  allowedObjects += " MUON/Calib/RegionalTriggerConfig";
  allowedObjects += " MUON/Calib/RejectList";
  allowedObjects += " MUON/Calib/TriggerDCS";
  allowedObjects += " MUON/Calib/TriggerEfficiency";
  allowedObjects += " MUON/Calib/TriggerLut";
  allowedObjects += " MUON/Calib/MappingData";

  allowedObjects += " MUON/Align/Data";

  allowedObjects += " GRP/Align/Data";
  allowedObjects += " ITS/Align/Data";
  allowedObjects += " VZERO/Align/Data";
  allowedObjects += " FMD/Align/Data";  
  allowedObjects += " T0/Align/Data";
  allowedObjects += " TPC/Align/Data";
  allowedObjects += " TRD/Align/Data";
  allowedObjects += " TOF/Align/Data";
  allowedObjects += " ACORDE/Align/Data";

  allowedObjects += " HLT/Calib/esdLayout";
  allowedObjects += " HLT/Calib/RecoParam";
  allowedObjects += " HLT/Calib/StreamerInfo";
  allowedObjects += " PHOS/Align/Data";
  allowedObjects += " EMCAL/Align/Data";
  allowedObjects += " HMPID/Align/Data";
   allowedObjects += " ZDC/Align/Data";
   allowedObjects += " PMD/Align/Data";
   
   
  
  allowedObjects += " GRP/Calib/MeanVertexTPC";
  allowedObjects += " GRP/Calib/CosmicTriggers";
  allowedObjects += " GRP/Calib/LHCClockPhase";
  allowedObjects += " GRP/CTP/CTPtiming";
  allowedObjects += " GRP/CTP/TimeAlign";
  allowedObjects += " GRP/Calib/RecoParam";
  allowedObjects += " GRP/CTP/Aliases";

  allowedObjects += " ITS/Calib/RecoParam";
  allowedObjects += " ITS/Calib/SPDNoisy";
  allowedObjects += " ITS/Calib/SPDDead";
  allowedObjects += " ITS/Calib/SPDSparseDead";
  allowedObjects += " ITS/Calib/CalibSDD";
  allowedObjects += " ITS/Calib/RespSDD";
  allowedObjects += " ITS/Calib/DriftSpeedSDD";
  allowedObjects += " ITS/Calib/DDLMapSDD";
  allowedObjects += " ITS/Calib/MapsTimeSDD";
  allowedObjects += " ITS/Calib/NoiseSSD";
  allowedObjects += " ITS/Calib/GainSSD";
  allowedObjects += " ITS/Calib/BadChannelsSSD";
  allowedObjects += " ITS/Calib/SPDFOEfficiency";
  
  allowedObjects += " ITS/Calib/SPDFONoise";
  
  allowedObjects += " TRIGGER/SPD/PITConditions";
  
  allowedObjects += " AD/Align/Data";
  */
  
  AliCDBManager* cdb = AliCDBManager::Instance();
  // determine dynamically the current year
  TString fromUri(fromURI);
  cdb->SetDefaultStorage(fromUri.Data());
  cdb->SetRun(runnr);
  cdb->SetDrain(toURI);
  TString toUri(toURI);
  
  AliCDBStorage *defaultStorage = cdb->GetDefaultStorage();
  defaultStorage->QueryCDB(runnr);
  TObjArray* allIdsForRun = defaultStorage->GetQueryCDBList();
  TIter next(allIdsForRun);
  AliCDBId* id = 0;
  while ((id = dynamic_cast<AliCDBId*>(next())))
  {
    TString path(id->GetPath());
    if ( !allowedObjects.Contains(path.Data() ) ) continue;

    cdb->Get(path,cdb->GetRun());
  }
  
}
/**
 * @file makeConfigurationObjectT0Reconstruction.C
 * @brief Creation of HLT component configuration objects in OCDB
 *
 * <pre>
 * Usage: aliroot -b -q makeConfigurationObjectT0Reconstruction.C'("param", "uri", runMin, runMax)'
 * </pre>
 *
 * Create an OCDB entry with a TObjString containing param for the 
 * T0 reconstruction.
 *
 * Parameters: <br>
 * - param (opt)    string to be stored in the TObjSting, default empty
 * - uri   (opt)    the OCDB URI, default $ALICE_ROOT   
 * - runMin (opt)   default 0
 * - runMax (opt)   default 999999999
 * 
 * Current Param : 
 *  - ""  <pre> aliroot -b -q makeConfigurationObjectT0Reconstruction.C </pre>
 *
 * @author Jochen Thaeder <*****@*****.**>
 * @ingroup alihlt_vzero
 */
void makeConfigurationObjectT0Reconstruction(const Char_t* param="", const Char_t* cdbUri=NULL,
				      Int_t runMin=0, Int_t runMax=AliCDBRunRange::Infinity()) {

  // --------------------------------------
  // -- Setup CDB
  // --------------------------------------
  cout<<" makeConfigurationObjectT0Reconstruction "<<endl;
  AliCDBManager* man = AliCDBManager::Instance();
  if (!man) {
    cerr << "Error : Can not get AliCDBManager" << end;
    exit;
  }

  TString storage;
  if (!man->IsDefaultStorageSet()) {
    if ( cdbUri ) {
      storage = cdbUri;
      if ( storage.Contains("://") == 0 ) {
	storage = "local://"; 
	storage += cdbUri;
      }
    } 
    else {
      storage="local://$ALICE_ROOT/OCDB";
    }
    man->SetDefaultStorage(storage);
  } 
  else {
    storage = man->GetDefaultStorage()->GetURI();
  }

 // TString path("HLT/ConfigT0/T0Reconstruction");
  TString path("HLT/ConfigT0/T0Calibration");
  cout<<path<<endl;

  // --------------------------------------
  // -- Create Config Object
  // --------------------------------------

  // here is the actual content of the configuration object
  TObjString configParam=param;

  TObject *configObj = static_cast<TObject*>(&configParam);
  // --------------------------------------
  // -- Fill Object
  // --------------------------------------
  
  if ( !configObj ) {
    cerr << "Error : No configuration object created" << endl;
    return;
  }
    
  AliCDBPath cdbPath(path);
  AliCDBId   cdbId(cdbPath, runMin, runMax);
  AliCDBMetaData cdbMetaData;
  man->Put(configObj, cdbId, &cdbMetaData);

  printf("Adding %s type OCDB object to %s [%d,%d] in %s \n",
	 configObj->ClassName(), 
	 path.Data(),
	 runMin, runMax, storage.Data());
}