本文整理汇总了C++中AliCDBMetaData::SetAliRootVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBMetaData::SetAliRootVersion方法的具体用法?C++ AliCDBMetaData::SetAliRootVersion怎么用?C++ AliCDBMetaData::SetAliRootVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliCDBMetaData
的用法示例。
在下文中一共展示了AliCDBMetaData::SetAliRootVersion方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeADLightYieldsEntry
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;
}
示例2: id
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);
}
示例3: id
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);
}
示例4: MakeMFTZeroMisAlignment
void MakeMFTZeroMisAlignment(TString Storage = "alien://folder=/alice/cern.ch/user/a/auras/OCDB/") {
// Create TClonesArray of zero misalignment objects for MFT
const char* macroname = "MakeMFTZeroMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
Int_t iIndex=0;
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
TString MFT("MFT");
new (alobj[0]) AliAlignObjParams(MFT.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
// save in CDB storage
if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
return;
}
Info(macroname,"Saving alignment objects in CDB storage %s", Storage.Data());
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return;
}
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Antonio Uras");
md->SetComment("Alignment objects for MFT zero-misalignment");
md->SetAliRootVersion(gROOT->GetVersion());
AliCDBId id("MFT/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
array->Delete();
}
示例5: MakeTRDResMisAlignment
//.........这里部分代码省略.........
AliCDBStorage* storage;
if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
TString 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());
return;
}
storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return;
}
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();
AliGeomManager::SetGeometry(geom);
}
else {
AliGeomManager::LoadGeometry(); //load geom from default CDB storage
}
// sigmas for the chambers
Double_t chdx = 0.002; // 20 microns
Double_t chdy = 0.003; // 30 microns
Double_t chdz = 0.007; // 70 microns
Double_t chrx = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
Double_t chry = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
Double_t chrz = 0.1 / 1000.0 / TMath::Pi()*180; // 0.1 mrad
// Truncation for the chambers
Double_t cutChdx = 3.0 * chdx;
Double_t cutChdy = 3.0 * chdy;
Double_t cutChdz = 0.14 * chdz;
Int_t sActive[18]={1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1};
Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
Int_t j=0;
UShort_t volid;
const char* symname;
// create the supermodules' alignment objects
for (Int_t iSect=0; iSect<18; iSect++) {
TString sm_symname(Form("TRD/sm%02d",iSect));
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new((*array)[j++])
AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kTRUE);
}
// create the chambers' alignment objects
Int_t chId;
for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
chId=-1;
for (Int_t iSect = 0; iSect < 18; iSect++){
for (Int_t iCh = 0; iCh < 5; iCh++) {
dx = AliMathBase::TruncatedGaus(0.0,chdx,cutChdx);
dy = AliMathBase::TruncatedGaus(0.0,chdy,cutChdy);
dz = AliMathBase::TruncatedGaus(0.0,chdz,cutChdz);
rx = gRandom->Rndm() * 2.0*chrx - chrx;
ry = gRandom->Rndm() * 2.0*chry - chry;
rz = gRandom->Rndm() * 2.0*chrz - chrz;
chId++;
if ((iSect==13 || iSect==14 || iSect==15) && iCh==2) continue;
volid = AliGeomManager::LayerToVolUID(iLayer,chId);
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
symname = AliGeomManager::SymName(volid);
new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
}
if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
// save on file
const char* filename = "TRDresidualMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
Error(macroname,"cannot open file for output\n");
return;
}
Info(macroname,"Saving alignment objects to the file %s", filename);
f.cd();
f.WriteObject(array,"TRDAlignObjs","kSingleKey");
f.Close();
}
else {
// save in CDB storage
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Dariusz Miskowiec");
md->SetComment("Residual misalignment for TRD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}
示例6: SetOCDBFromRun1
///
/// 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);
}
示例7: MakeTRDFullMisAlignment
//.........这里部分代码省略.........
Double_t smrx = 0.4 / 1000.0 / TMath::Pi()*180; // 0.4 mrad
Double_t smry = 2.0 / 1000.0 / TMath::Pi()*180; // 2.0 mrad
Double_t smrz = 0.4 / 1000.0 / TMath::Pi()*180; // 0.4 mrad
// Truncation for the chambers
Double_t cutSmdx = 3.0 * smdx;
Double_t cutSmdy = 3.0 * smdy;
Double_t cutSmdz = 3.0 * smdz;
// Sigmas for the chambers
Double_t chdx = 0.05; // 0.5 mm
Double_t chdy = 0.1; // 1.0 mm
Double_t chdz = 0.007; // 70 microns
Double_t chrx = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
Double_t chry = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
Double_t chrz = 0.3 / 1000.0 / TMath::Pi()*180; // 0.3 mrad
// Truncation for the chambers
Double_t cutChdx = 1.0 * chdx;
Double_t cutChdy = 1.0 * chdy;
Double_t cutChdz = 0.14 * chdz;
Int_t sActive[18]={1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1};
Double_t dx,dy,dz,rx,ry,rz;
Int_t j=0;
UShort_t volid;
const char *symname;
// create the supermodules' alignment objects
for (int iSect; iSect<18; iSect++) {
TString sm_symname(Form("TRD/sm%02d",iSect));
dx = AliMathBase::TruncatedGaus(0.0,smdx,cutSmdx);
dy = AliMathBase::TruncatedGaus(0.0,smdy,cutSmdy);
dz = AliMathBase::TruncatedGaus(0.0,smdz,cutSmdz);
rx = gRandom->Rndm() * 2.0*smrx - smrx;
ry = gRandom->Rndm() * 2.0*smry - smry;
rz = gRandom->Rndm() * 2.0*smrz - smrz;
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new((*array)[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
}
// apply supermodules' alignment objects
Int_t smCounter=0;
for(Int_t iSect=0; iSect<18; iSect++){
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
AliAlignObjParams* smobj =
(AliAlignObjParams*)array->UncheckedAt(smCounter++);
if(!smobj->ApplyToGeometry()){
Fatal(macroname,Form("application of full misalignment object for sector %d failed!",iSect));
return;
}
}
// create the chambers' alignment objects
ran = new TRandom(4357);
Int_t chId;
for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
chId=-1;
for (Int_t iSect = 0; iSect < 18; iSect++){
for (Int_t iCh = 0; iCh < 5; iCh++) {
dx = AliMathBase::TruncatedGaus(0.0,chdx,cutChdx);
dy = AliMathBase::TruncatedGaus(0.0,chdy,cutChdy);
dz = AliMathBase::TruncatedGaus(0.0,chdz,cutChdz);
rx = gRandom->Rndm() * 2.0*chrx - chrx;
ry = gRandom->Rndm() * 2.0*chry - chry;
rz = gRandom->Rndm() * 2.0*chrz - chrz;
chId++;
if ((iSect==13 || iSect==14 || iSect==15) && iCh==2) continue;
volid = AliGeomManager::LayerToVolUID(iLayer,chId);
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
symname = AliGeomManager::SymName(volid);
new((*array)[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
}
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TRDfullMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
Error(macroname,"cannot open file for output\n");
return;
}
Info(macroname,"Saving alignment objects to the file %s", filename);
f.cd();
f.WriteObject(array,"TRDAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
Info(macroname,"Saving alignment objects in CDB storage %s",
Storage.Data());
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Dariusz Miskowiec");
md->SetComment("Full misalignment for TRD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}
示例8: MakeCosmicTriggersEntry
Bool_t MakeCosmicTriggersEntry(const char *fileName, const char* cdbUri)
{
const char* macroname = "MakeCosmicTriggersEntry.C";
if (gSystem->AccessPathName(fileName)) {
Error(macroname,Form("file (%s) not found", fileName));
return kFALSE;
}
ifstream *file = new ifstream(fileName);
if (!*file) {
Error(macroname,Form("Error opening file (%s) !",fileName));
file->close();
delete file;
return kFALSE;
}
THashTable *table = new THashTable();
table->SetName("List of defined cosmic triggers");
TString strLine;
while (strLine.ReadLine(*file)) {
if (strLine.BeginsWith("#")) continue;
strLine.ReplaceAll(" ","");
strLine.ReplaceAll("\t","");
if (strLine.IsNull()) continue;
TObjString *obj = new TObjString(strLine.Data());
table->Add(obj);
}
file->close();
delete file;
// create OCDB storage
TString Storage(cdbUri);
if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
return kFALSE;
}
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return kFALSE;
}
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Federico Antinori");
md->SetComment("List of the defined cosmic triggers. It is used in order to steer the reconstruction, namely in the selection of the proper event specie. It is maintained and updated by the trigger coordinator.");
// Get root and AliRoot versions and set them in the metadata
const char* rootv = gROOT->GetVersion();
TString av(ALIROOT_VERSION);
TString revnum(ALIROOT_REVISION);
av+=" - revision: ";
av+=revnum;
md->SetAliRootVersion(av.Data());
AliCDBId id("GRP/Calib/CosmicTriggers",0,AliCDBRunRange::Infinity());
Info(macroname,"Saving the list of defined cosmic triggers in the OCDB storage \"%s\"",Storage.Data());
storage->Put(table,id,md);
table->Delete();
delete table;
return kTRUE;
}
示例9: MakeACORDEZeroMisAlignment
void MakeACORDEZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for ACORDE
//
const char* macroname = "MakeACORDEZeroMisAlignment.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);
AliCDBStorage* storage;
//load geom from local file till ACORDE is not switched on by default in standard config-files
if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
TString 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());
return;
}
storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return;
}
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();
AliGeomManager::SetGeometry(geom);
}else{
AliGeomManager::LoadGeometry(); //load geom from default CDB storage
}
// AliGeomManager::LoadGeometry("geometry.root");
TClonesArray *array = new TClonesArray("AliAlignObjParams",64);
TClonesArray &alobj = *array;
TRandom *rnd = new TRandom(4321);
Int_t j = 0;
Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
// RS = local
// sigma translation
// sigma rotation
TString symname;
TString basename = "ACORDE/Array";
Int_t iIndex=0;
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
for (Int_t imod=0; imod<60; imod++){
symname = basename;
symname += imod;
new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);
}
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "ACORDEZeroMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
Error(macroname,"cannot open file for output\n");
return;
}
Info(macroname,"Saving alignment objects to the file %s", filename);
f.cd();
f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("E. Cuautle & M. Rodriguez");
md->SetComment("Zero misalignment for ACORDE");
md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}
示例10: MakeTOFResMisAlignment
//.........这里部分代码省略.........
AliGeomManager::LoadGeometry(); //load geom from default CDB storage
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
Int_t j=0;
Int_t nSectors=18;
//Produce objects for TOF supermodules
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy vol id
Double_t smdx, smdy, smdz=0., dpsi=0., dtheta, dphi=0.;
for(Int_t isect=0; isect<nSectors; isect++) {
TString symname(Form("TOF/sm%02d",isect));
new(alobj[j++]) AliAlignObjParams(symname.Data(),
dvoluid,
smdx, smdy, smdz, dpsi, dtheta, dphi, kFALSE);
}
Int_t strId=-1;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
//TRandom *rnd = new TRandom(4357);
Double_t sigmatr = 0.1; // sigma (in cm) for shift w.r.t. local ideal RS
Int_t nstrA=15;
Int_t nstrB=19;
Int_t nstrC=19;
Int_t nStrips=nstrA+2*nstrB+2*nstrC;
Double_t cuty=0., cutz=0., cut=3*sigmatr;
for (Int_t isect = 0; isect < nSectors; isect++) {
for (Int_t istr = 1; istr <= nStrips; istr++) {
//dy = rnd->Gaus(0.,sigmatr);
//dz = rnd->Gaus(0.,sigmatr);
//strId++;
switch (istr) {
case 25:
case 29:
case 63:
case 67:
cuty = sigmatr*0.6;
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut, cuty);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cut);
strId++;
break;
/*
case 38:
cuty = sigmatr*2.5;
cutz = sigmatr*2.5;
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut, cuty);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cut, cutz);
strId++;
break;
case 54:
cuty = sigmatr*2.5;
cutz = sigmatr*2.5;
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut, cuty);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cutz, cut);
strId++;
break;
*/
default:
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cut);
strId++;
break;
}
if ((isect==13 || isect==14 || isect==15) && (istr >= 39 && istr <= 53)) continue;
new(alobj[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,strId),
AliGeomManager::LayerToVolUID(idTOF,strId),
dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
}
}
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
// save on file
const char* filename = "TOFresidualMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
Error(macroname,"cannot open file for output\n");
return;
}
Info(macroname,"Saving alignment objects to the file %s", filename);
f.cd();
f.WriteObject(array,"TOFAlignObjs","kSingleKey");
f.Close();
} else {
// save in CDB storage
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Silvia Arcelli");
md->SetComment("Residual misalignment for TOF, sigmatr=1mm in the local RS");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
AliCDBId id("TOF/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}
示例11: MakeZDCFullMisAlignment
void MakeZDCFullMisAlignment(){
// Create TClonesArray of full misalignment objects for ZDC
//
const char* macroname = "MakeZDCFullMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
Double_t dx=0., dy=2., dz=0.;
Double_t dpsi=0., dtheta=0., dphi=0.;
const char *ZDCCn="ZDC/NeutronZDC_C";
const char *ZDCCp="ZDC/ProtonZDC_C";
const char *ZDCAn="ZDC/NeutronZDC_A";
const char *ZDCAp="ZDC/ProtonZDC_A";
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
new(alobj[0]) AliAlignObjParams(ZDCCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCCp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[2]) AliAlignObjParams(ZDCAn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[3]) AliAlignObjParams(ZDCAp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save in file
const char* filename = "ZDCfullMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
Error(macroname,"cannot open file for output\n");
return;
}
Info(macroname,"Saving alignment objects to the file %s", filename);
f.cd();
f.WriteObject(array,"ZDCAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
TString 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());
return;
}
Info(macroname,"Saving alignment objects in CDB storage %s",
Storage.Data());
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return;
}
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Chiara Oppedisano");
md->SetComment("Alignment objects for ZDC full misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
AliCDBId id("ZDC/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}