AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "EMCALfullMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "EMCALresidualMisalignment.root";
TFile f(filename,"RECREATE");
new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "EMCALzeroMisalignment.root";
TFile f(filename,"RECREATE");
fHalfRotMin(0,0,0),
fHalfRotMax(0,0,0),
fRunMin(0),
- fRunMax(9999999),
+ fRunMax(AliCDBRunRange::Infinity()),
fArray(0),
fComment("")
{
TString Storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
gSystem->Load("libFMDutil.so");
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDfullMisalignment.root");
}else{
TString Storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
gSystem->Load("libFMDutil.so");
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDresidualMisalignment.root");
}else{
TString Storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
gSystem->Load("libFMDutil.so");
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDAlignObjs.root");
}else{
--- /dev/null
+void MakeSTRUCTFullMisAlignment(){
+ // Create TClonesArray of full misalignment objects for all STRUCTures
+ // (presently this includes only FRAME)
+ // Full alignment objects for FRAME segments are built by
+ // averaging in each supermodule the values produced by the
+ // ANSYS finite-elements simulation
+ //
+ const char* macroname = "MakeSTRUCTFullMisAlignment.C";
+ TClonesArray *array = new TClonesArray("AliAlignObjParams",20);
+
+ // the following hardcoded values have been obtained by taking the output of the ANSYS simulation
+ // (finite elements simulation of deformations for given loads) and recalculating the avarege
+ // displacement of the center of each space-frame sector
+ ((*array)[0]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO0_1",0,0.13375,-0.0275,0,0,0,0,kTRUE);
+ ((*array)[1]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO1_1",0,0.25125,0.00125,0,0,0,0,kTRUE);
+ ((*array)[2]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO2_1",0,0.2325,-0.03625,0,0,0,0,kTRUE);
+ ((*array)[3]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO3_1",0,0.17,-0.14375,0,0,0,0,kTRUE);
+ ((*array)[4]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO4_1",0,0.1475,-0.2,0,0,0,0,kTRUE);
+ ((*array)[5]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO5_1",0,0.12625,-0.13375,0,0,0,0,kTRUE);
+ ((*array)[6]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO6_1",0,0.06375,-0.02125,0,0,0,0,kTRUE);
+ ((*array)[7]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO7_1",0,0.0475,0.015,0,0,0,0,kTRUE);
+ ((*array)[8]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO8_1",0,0.1775,-0.0175,0,0,0,0,kTRUE);
+ ((*array)[9]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO9_1",0,0.32375,-0.03125,0,0,0,0,kTRUE);
+ ((*array)[10]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO10_1",0,0.35125,-0.0325,0,0,0,0,kTRUE);
+ ((*array)[11]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO11_1",0,0.285,-0.105,0,0,0,0,kTRUE);
+ ((*array)[12]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO12_1",0,0.205,-0.24375,0,0,0,0,kTRUE);
+ ((*array)[13]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO13_1",0,0.1775,-0.32,0,0,0,0,kTRUE);
+ ((*array)[14]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO14_1",0,0.1525,-0.25375,0,0,0,0,kTRUE);
+ ((*array)[15]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO15_1",0,0.07625,-0.1225,0,0,0,0,kTRUE);
+ ((*array)[16]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO16_1",0,0.0075,-0.04875,0,0,0,0,kTRUE);
+ ((*array)[17]) = new AliAlignObjParams("ALIC_1/B077_1/BSEGMO17_1",0,0.01375,-0.04125,0,0,0,0,kTRUE);
+
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+ // save on file
+ const char* filename = "STRUCTfullMisalignment.root";
+ TFile f(filename,"RECREATE");
+ if(!f){
+ Error(macroname,"cannot open file for output\n");
+ return;
+ }
+ Info(macroname,"Saving alignment objects in %s", filename);
+ f.cd();
+ f.WriteObject(array,"STRUCTAlignObjs","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("Grosso Raffaele");
+ md->SetComment("Full misalignment for FRAME, including dead weight and full weight deformations derived from ANSYS finiteelements simulation: dispmap corrected excel worksheet from Werner Riegler");
+ md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+ AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity());
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
--- /dev/null
+void MakeSTRUCTResMisAlignment(){
+ // Create TClonesArray of residual misalignment objects for all STRUCTures
+ // (presently this includes only FRAME)
+ //
+ const char* macroname = "MakeSTRUCTResMisAlignment.C";
+
+ TClonesArray *array = new TClonesArray("AliAlignObjParams",20);
+
+ 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
+
+ const char* basepath ="ALIC_1/B077_1/BSEGMO";
+ TString segmpath;
+
+ for(Int_t sm=0; sm<18; sm++){
+ segmpath=basepath;
+ segmpath+=sm;
+ segmpath+="_1";
+ cout<<segmpath.Data()<<endl;
+ new((*array)[sm]) AliAlignObjParams(segmpath.Data(),dvoluid,0.,0.,0.,0.,0.,0.,kTRUE);
+ }
+
+
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+ // save on file
+ const char* filename = "STRUCTresMisalignment.root";
+ TFile f(filename,"RECREATE");
+ if(!f){
+ Error(macroname,"cannot open file for output\n");
+ return;
+ }
+ Info(macroname,"Saving alignment objects in %s", filename);
+ f.cd();
+ f.WriteObject(array,"STRUCTAlignObjs","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("Grosso Raffaele");
+ md->SetComment("Residual misalignment for STRUCT. Presently includes objects for FRAME.");
+ md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+ AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity());
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
--- /dev/null
+void MakeSTRUCTZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for all STRUCTures
+ // (presently this includes only FRAME)
+ //
+ const char* macroname = "MakeSTRUCTZeroMisAlignment.C";
+
+ TClonesArray *array = new TClonesArray("AliAlignObjParams",20);
+
+ 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
+
+ const char* basepath ="ALIC_1/B077_1/BSEGMO";
+ TString segmpath;
+
+ for(Int_t sm=0; sm<18; sm++){
+ segmpath=basepath;
+ segmpath+=sm;
+ segmpath+="_1";
+ cout<<segmpath.Data()<<endl;
+ new((*array)[sm]) AliAlignObjParams(segmpath.Data(),dvoluid,0.,0.,0.,0.,0.,0.,kTRUE);
+ }
+
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+ // save on file
+ const char* filename = "STRUCTzeroMisalignment.root";
+ TFile f(filename,"RECREATE");
+ if(!f){
+ Error(macroname,"cannot open file for output\n");
+ return;
+ }
+ Info(macroname,"Saving alignment objects in %s", filename);
+ f.cd();
+ f.WriteObject(array,"STRUCTAlignObjs","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("Grosso Raffaele");
+ md->SetComment("Zero misalignment for STRUCT: presently includes objects for FRAME");
+ md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+ AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity());
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
-void UpdateCDBIdealGeom(){
- // produce the ideal geometry with the current AliRoot and store it in the
- // CDB
+void UpdateCDBIdealGeom(const char* cdbUri, const char* cfgFile){
+ // Produce the ideal geometry and store it in the specified CDB
+ // The second argument allows to specify the config file to be used
+ // in particular for giving the choice to generate either a full or
+ // a partial geometry.
+ //
- AliCDBManager* man = AliCDBManager::Instance();
- man->SetDefaultStorage("local://$ALICE_ROOT");
- man->SetRun(0);
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ // we set the default storage to the repository because some dets require
+ // already at the time of geometry creation to find calibration objects in the cdb
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBStorage* storage = cdb->GetStorage(cdbUri);
+ cdb->SetRun(0);
AliCDBId id("GRP/Geometry/Data",0,AliCDBRunRange::Infinity());
AliCDBMetaData *md= new AliCDBMetaData();
- // Get root version
+ // Get root and AliRoot versions
const char* rootv = gROOT->GetVersion();
+ gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
+ TString av(GetARversion());
- // Get AliRoot version from file to set it in the metadata of the entry
- TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
- Int_t size = fv->GetSize();
- char *buf = new Char_t[size];
- memset(buf, '\0', size);
- fv->Seek(0);
- char* alirootv;
- if ( fv->ReadBuffer(buf, size) ) {
- Printf("Error reading AliRoot version from file to buffer!");
- alirootv = "";
- }
- if(buf=="AliRoot"){
- alirootv="HEAD";
- }else{
- alirootv = buf;
- md->SetAliRootVersion(alirootv);
- md->SetComment(Form("Geometry produced with root version %s and AliRoot version %s",rootv,alirootv));
- }
+ md->SetAliRootVersion(av.Data());
+ md->SetComment(Form("Geometry produced with root version %s and AliRoot version %s",rootv,av.Data()));
- gAlice->Init();
+ gAlice->Init(cfgFile);
if(!gGeoManager){
Printf("Unable to produce a valid geometry to be put in the CDB!");
return;
}
- Printf("Storing in CDB geometry produced with root version %s and AliRoot version %s",rootv,alirootv);
- man->Put(gGeoManager,id,md);
+ Printf("Storing in CDB geometry produced with root version %s and AliRoot version %s",rootv,av.Data());
+ storage->Put(gGeoManager,id,md);
+ // This is to allow macros lauched after this one in the same session to find the
+ // newly produced geometry.
+ storage->QueryCDB(cdb->GetRun());
}
+
+
// pCA->Print();
const char* macroname = "MakeHMPIDResMisAlignment.C";
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "HMPIDresidualMisalignment.root";
TFile f(filename,"RECREATE");
// pCA->Print();
const char* macroname = "MakeHMPIDResMisAlignment.C";
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "HMPIDresidualMisalignment.root";
TFile f(filename,"RECREATE");
// pCA->Print();
const char* macroname = "MakeHMPIDZeroMisAlignment.C";
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "HMPIDzeroMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "ITSfullMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "ITSresidualMisalignment.root";
TFile f(filename,"RECREATE");
}
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "ITSzeroMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
// ************************* 2nd step ***************
const char* macroname = "MakePHOSFullMisAlignment.C";
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "PHOSfullMisalignment.root";
TFile f(filename,"RECREATE");
geodesicData.CreateAliAlignObjParams(alobj);
const char* macroname = "MakePHOSResMisAlignment.C";
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "PHOSresidualMisalignment.root";
TFile f(filename,"RECREATE");
AliPHOSSurvey geodesicData;
geodesicData.CreateNullObjects(alobj, phosGeom);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "PHOSzeroMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
new(alobj[2]) AliAlignObjParams(Sector3, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
new(alobj[3]) AliAlignObjParams(Sector4, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// Create a File to store the alignment data
const char* filename = "PMDfullMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
new(alobj[2]) AliAlignObjParams(Sector3, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
new(alobj[3]) AliAlignObjParams(Sector4, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// Create a File to store the alignment data
const char* filename = "PMDresidualMisalignment.root";
TFile f(filename,"RECREATE");
new(alobj[j++]) AliAlignObjParams(snSector.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// Create a File to store the alignment data
const char* filename = "PMDzeroMisalignment.root";
TFile f(filename,"RECREATE");
cdb->SetRun(0);
AliCDBStorage* storage;
+ TString Storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
- TString Storage = gSystem->Getenv("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());
return;
// load FRAME full misalignment objects (if needed, the macro
// for FRAME has to be run in advance) and apply them to geometry
- Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
- Storage.Data());
AliCDBPath fpath("GRP","Align","Data");
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
+ Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
+ Storage.Data());
AliCDBEntry *eFrame = storage->Get(fpath.GetPath(),cdb->GetRun());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
- TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
- arFrame->Sort();
- Int_t nvols = arFrame->GetEntriesFast();
- Bool_t flag = kTRUE;
- for(Int_t j=0; j<nvols; j++)
- {
- AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
- if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
- }
- if(!flag)
- Fatal(macroname,"Error in the application of FRAME alignment objects");
}else{
AliCDBEntry *eFrame = cdb->Get(fpath.GetPath());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
- TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
- arFrame->Sort();
- Int_t nvols = arFrame->GetEntriesFast();
- Bool_t flag = kTRUE;
- for(Int_t j=0; j<nvols; j++)
- {
- AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
- if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
- }
- if(!flag)
- Fatal(macroname,"Error in the application of FRAME alignment objects");
}
+ if(!eFrame) Fatal(macroname,"Could not get the specified CDB entry!");
+ TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
+ arFrame->Sort();
+ Int_t nvols = arFrame->GetEntriesFast();
+ Bool_t flag = kTRUE;
+ for(Int_t j=0; j<nvols; j++)
+ {
+ AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
+ if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
+ }
+ if(!flag) Fatal(macroname,"Error in the application of FRAME alignment objects");
//Produce objects for TOF supermodules
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy vol id
Int_t nSMTOF = 18;
+ Int_t sActive[18]={0,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1};
Int_t j=0;
- Double_t smdx, smdy, smdz, dpsi, dtheta, dphi;
+ Double_t smdx, smdy, smdz=0., dpsi=0., dtheta, dphi=0.;
TRandom *rnd = new TRandom(2345);
Double_t sigmatr = 0.4; // max shift in cm w.r.t. local ideal RS
Double_t sigmarot = 0.06; // max rot in deg w.r.t. local ideal RS (~ 1 mrad)
- for(Int_t i=0; i<nSMTOF; i++) {
- TString symname(Form("TOF/sm%02d",i));
+ for(Int_t iSect=0; iSect<nSMTOF; iSect++) {
+ TString symname(Form("TOF/sm%02d",iSect));
smdx = rnd->Gaus(0.,sigmatr);
smdy = rnd->Gaus(0.,sigmatr);
- smdz =0;
- dpsi = 0.;
dtheta = rnd->Gaus(0.,sigmarot);
- dphi = 0.;
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new((*array)[j++]) AliAlignObjParams(symname.Data(), dvoluid, smdx, smdy, smdz, dpsi, dtheta, dphi, kFALSE);
}
// Apply objects for TOF supermodules
- for(Int_t i=0; i<nSMTOF; i++){
- AliAlignObjParams* smobj = (AliAlignObjParams*)array->UncheckedAt(i);
+ Int_t smCounter=0;
+ for(Int_t iSect=0; iSect<nSMTOF; iSect++){
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+ AliAlignObjParams* smobj = (AliAlignObjParams*)array->UncheckedAt(smCounter++);
+ Info(macroname,Form("Applying object for sector %d ",iSect));
if(!smobj->ApplyToGeometry()){
- cout<<"application of object "<<i<<" failed!"<<endl;
+ Fatal(macroname,Form("application of full misalignment object for sector %d failed!",iSect));
return;
}
}
//Produce objects for TOF strips (same sigmas as for residual misalignment)
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
+ Int_t strId=-1;
- Double_t sdx=0.;
- Double_t sdy=0.;
- Double_t sdz=0.;
- Double_t sdpsi, sdtheta, sdphi;
+ Double_t sdx=0., sdy=0., sdz=0., sdpsi=0., sdtheta=0., sdphi=0.;
TRandom *rnds = new TRandom(4357);
sigmatr = 0.1; // max shift in cm w.r.t. local ideal RS
- for(i=0; i<AliGeomManager::LayerSize(idTOF); i++) {
- sdx = 0;
+ Int_t nstrA=15;
+ Int_t nstrB=19;
+ Int_t nstrC=19;
+ Int_t nSectors=18;
+ Int_t nStrips=nstrA+2*nstrB+2*nstrC;
+
+ for (Int_t iSect = 0; iSect < nSectors; iSect++) {
+ for (Int_t istr = 1; istr <= nStrips; istr++) {
sdy = rnds->Gaus(0.,sigmatr);
sdz = rnds->Gaus(0.,sigmatr);
- sdpsi = 0.;
- sdtheta = 0.;
- sdphi = 0.;
- new((*array)[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), sdx, sdy, sdz, sdpsi, sdtheta, sdphi, kFALSE);
+ strId++;
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+ new((*array)[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,strId),AliGeomManager::LayerToVolUID(idTOF,strId), sdx, sdy, sdz, sdpsi, sdtheta, sdphi, kFALSE);
+ }
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save in file
const char* filename = "TOFfullMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
- Int_t i;
Int_t j=0;
- Double_t dx=0.;
- Double_t dy=0.;
- Double_t dz=0.;
- Double_t dpsi, dtheta, dphi;
+ 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
- for(i=0; i<AliGeomManager::LayerSize(idTOF); i++) {
- dx = 0;
+ Int_t sActive[18]={0,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1};
+
+ Int_t nstrA=15;
+ Int_t nstrB=19;
+ Int_t nstrC=19;
+ Int_t nSectors=18;
+ Int_t nStrips=nstrA+2*nstrB+2*nstrC;
+
+ 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);
- dpsi = 0.;
- dtheta = 0.;
- dphi = 0.;
- new(alobj[j]) AliAlignObjParams(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
- j++;
+ strId++;
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+ new(alobj[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,strId),AliGeomManager::LayerToVolUID(idTOF,strId), dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+ }
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TOFresidualMisalignment.root";
TFile f(filename,"RECREATE");
TClonesArray &alobj = *array;
const char* macroname = "MakeTOFZeroMisAlignment.C";
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ 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
+ }
+
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
- Int_t i;
Int_t j=0;
+ Int_t strId=-1;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
- for(i=0; i<AliGeomManager::LayerSize(idTOF); i++) {
- new(alobj[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+ Int_t sActive[18]={0,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1};
+
+ Int_t nstrA=15;
+ Int_t nstrB=19;
+ Int_t nstrC=19;
+ Int_t nSectors=18;
+ Int_t nStrips=nstrA+2*nstrB+2*nstrC;
+
+ for (Int_t isect = 0; isect < nSectors; isect++) {
+ for (Int_t istr = 1; istr <= nStrips; istr++) {
+ strId++;
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+ new(alobj[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,strId), AliGeomManager::LayerToVolUID(idTOF,strId), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TOFzeroMisalignment.root";
TFile f(filename,"RECREATE");
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("Silvia Arcelli");
md->SetComment("Zero misalignment for TOF");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TPCfullMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
}
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TPCresidualMisalignment.root";
TFile f(filename,"RECREATE");
}
}
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TPCzeroMisalignment.root";
TFile f(filename,"RECREATE");
cdb->SetRun(0);
AliCDBStorage* storage;
+ TString Storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
- TString Storage = gSystem->Getenv("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());
return;
// load FRAME full misalignment objects (if needed, the macro
// for FRAME has to be ran in advance) and apply them to geometry
- Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
- Storage.Data());
AliCDBPath fpath("GRP","Align","Data");
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
- AliCDBEntry *eFrame = storage->Get(fpath.GetPath(),cdb->GetRun());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
- TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
- arFrame->Sort();
- Int_t nvols = arFrame->GetEntriesFast();
- Bool_t flag = kTRUE;
- for(Int_t j=0; j<nvols; j++)
- {
- AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
- if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
- }
- if(!flag)
- Fatal(macroname,"Error in the application of FRAME objects");
+ AliCDBEntry *eFrame;
+ if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
+ Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
+ Storage.Data());
+ eFrame = storage->Get(fpath.GetPath(),cdb->GetRun());
}else{
- AliCDBEntry *eFrame = cdb->Get(fpath.GetPath());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
- TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
- arFrame->Sort();
- Int_t nvols = arFrame->GetEntriesFast();
- Bool_t flag = kTRUE;
- for(Int_t j=0; j<nvols; j++)
- {
- AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
- if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
- }
- if(!flag)
- Fatal(macroname,"Error in the application of FRAME objects");
+ eFrame = cdb->Get(fpath.GetPath());
}
+ if(!eFrame) Fatal(macroname,"Could not get the specified CDB entry!");
+ TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
+ arFrame->Sort();
+ Int_t nvols = arFrame->GetEntriesFast();
+ Bool_t flag = kTRUE;
+ for(Int_t j=0; j<nvols; j++)
+ {
+ AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
+ if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
+ }
+ if(!flag) Fatal(macroname,"Error in the application of FRAME objects");
// sigmas for the supermodules
Double_t chry=1.0/1000/TMath::Pi()*180; // 1 mrad
Double_t chrz=0.7/1000/TMath::Pi()*180; // 0.7 mrad
+ Int_t sActive[18]={0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,1,0,0};
Double_t dx,dy,dz,rx,ry,rz;
Int_t j=0;
const char *symname;
// create the supermodules' alignment objects
- for (int i; i<18; i++) {
- TString sm_symname(Form("TRD/sm%02d",i));
+ for (int iSect; iSect<18; iSect++) {
+ TString sm_symname(Form("TRD/sm%02d",iSect));
ran->Rannor(dx,rx);
ran->Rannor(dy,ry);
ran->Rannor(dz,rz);
rx*=smrx;
ry*=smry;
rz*=smrz;
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new((*array)[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
}
-
- for(Int_t k=0; k<18; k++){
- AliAlignObjParams* smobj = (AliAlignObjParams*)array->UncheckedAt(k);
+ // apply supermodules' alignment objects
+ Int_t smCounter=0;
+ for(Int_t iSect=0; iSect<18; iSect++){
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+ AliAlignObjParams* smobj =
+ (AliAlignObjParams*)array->UncheckedAt(smCounter++);
if(!smobj->ApplyToGeometry()){
- cout<<"application of object "<<k<<" failed!"<<endl;
+ 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++) {
- for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
+ chId=-1;
+ for (Int_t iSect = 0; iSect < 18; iSect++){
+ for (Int_t iCh = 0; iCh < 5; iCh++) {
ran->Rannor(dx,rx);
ran->Rannor(dy,ry);
ran->Rannor(dz,rz);
rx*=chrx;
ry*=chry;
rz*=chrz;
- volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
+ chId++;
+ volid = AliGeomManager::LayerToVolUID(iLayer,chId);
symname = AliGeomManager::SymName(volid);
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new((*array)[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
+ }
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TRDfullMisalignment.root";
TFile f(filename,"RECREATE");
array->Delete();
}
-
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
Double_t chry=0.3/1000/TMath::Pi()*180; // 0.3 mrad
Double_t chrz=0.1/1000/TMath::Pi()*180; // 0.1 mrad
+ Int_t sActive[18]={0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,1,0,0};
Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
Int_t j=0;
const char* symname;
// create the supermodules' alignment objects
- for (int i; i<18; i++) {
- TString sm_symname(Form("TRD/sm%02d",i));
+ for (Int_t iSect=0; iSect<18; iSect++) {
+ TString sm_symname(Form("TRD/sm%02d",iSect));
+ if( (TString(gSystem->Getenv("PARTGEOM")) == 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++) {
- for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
+ chId=-1;
+ for (Int_t iSect = 0; iSect < 18; iSect++){
+ for (Int_t iCh = 0; iCh < 5; iCh++) {
ran->Rannor(dx,rx);
ran->Rannor(dy,ry);
ran->Rannor(dz,rz);
rx*=chrx;
ry*=chry;
rz*=chrz;
- volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
+ chId++;
+ volid = AliGeomManager::LayerToVolUID(iLayer,chId);
symname = AliGeomManager::SymName(volid);
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
+ }
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TRDresidualMisalignment.root";
TFile f(filename,"RECREATE");
TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
TClonesArray &alobj = *array;
-
+ Int_t sActive[18]={0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,1,0,0};
Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
Int_t j=0;
const char *symname;
// create the supermodules' alignment objects
- for (int i; i<18; i++) {
- TString sm_symname(Form("TRD/sm%02d",i));
+ for (Int_t iSect; iSect<18; iSect++) {
+ TString sm_symname(Form("TRD/sm%02d",iSect));
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new(alobj[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++) {
- for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
- volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
+ chId=-1;
+ for (Int_t iSect = 0; iSect < 18; iSect++){
+ for (Int_t iCh = 0; iCh < 5; iCh++) {
+ chId++;
+ volid = AliGeomManager::LayerToVolUID(iLayer,chId);
symname = AliGeomManager::SymName(volid);
+ if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kTRUE);
}
}
+ }
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TRDzeroMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
new(alobj[1]) AliAlignObjParams(V0left, volid, dx, dy, dz, dpsi, dtheta,
dphi,kFALSE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "VZEROfullMisalignment.root";
TFile f(filename,"RECREATE");
AliCDBStorage* storage;
- if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ 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());
dphi = rnd->Gaus(0.,sigmarot);
new(alobj[1]) AliAlignObjParams(V0left, volid, dx, dy, dz, dpsi, dtheta, dphi,kFALSE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "VZEROresidualMisalignment.root";
TFile f(filename,"RECREATE");
TString V0left("VZERO/V0A");
new(alobj[1]) AliAlignObjParams(V0left.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "VZEROzeroMisalignment.root";
TFile f(filename,"RECREATE");
new(alobj[0]) AliAlignObjParams(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save in file
const char* filename = "ZDCfullMisalignment.root";
TFile f(filename,"RECREATE");
new(alobj[0]) AliAlignObjParams(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save in file
const char* filename = "ZDCresidualMisalignment.root";
TFile f(filename,"RECREATE");
new(alobj[0]) AliAlignObjParams(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save in file
const char* filename = "ZDCzeroMisalignment.root";
TFile f(filename,"RECREATE");
--- /dev/null
+const char* GetARversion(){
+//void GetARversion(){
+ // Returns AliRoot version extracted from what is found in the
+ // $ALICE_ROOT/CVS/ directory
+ //
+ TString vAli;
+ const char* vFile = gSystem->ExpandPathName("$ALICE_ROOT/CVS/Tag");
+ if(gSystem->AccessPathName(vFile)){
+ vAli="HEAD";
+ }else{
+ TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Tag?filetype=raw","READ");
+ Int_t size = fv->GetSize();
+ char *buf = new Char_t[size];
+ memset(buf, '\0', size);
+ fv->Seek(0);
+ if ( fv->ReadBuffer(buf, size) ) {
+ Warning("GetARversion.C","Error reading AliRoot version from file to buffer!");
+ vAli="";
+ }
+ vAli = buf;
+ if(vAli.Contains('\n')) vAli.Remove(vAli.First('\n'));
+ if(vAli.Contains('v')) vAli.Remove(0,vAli.First('v'));
+ }
+ delete vFile;
+ return vAli.Data();
+}
+
-const char* GetARversion();
-
-void MakeAllDETsFullMisAlignment(Char_t* CDBstorage = "local://$HOME/Full"){
+void MakeAllDETsFullMisAlignment(Char_t* CDBstorage = "local://$HOME/FullMisAlignment", Bool_t partialGeom=kFALSE){
// Make full misalignment objects for all detectors
// Pass different "CDBstorage" argument if needed (e.g. to fill
// conditions' data base on alien) or set it to null string to have
}else{
gSystem->Setenv("TOCDB","kTRUE");
gSystem->Setenv("STORAGE",strStorage.Data());
+ gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
gSystem->Setenv("ARVERSION",GetARversion());
}
+ if(partialGeom){
+ gSystem->Setenv("PARTGEOM","kTRUE");
+ }else{
+ gSystem->Setenv("PARTGEOM","kFALSE");
+ }
// Load geometry from CDB updating it if we are producing the
// alignment objects for the CDB
// update geometry in it
Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
- UpdateCDBIdealGeom(strStorage.Data());
+ if(partialGeom){
+ UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
+ }else{
+ UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");
+ }
// load the same geometry from given CDB storage
AliCDBPath path("GRP","Geometry","Data");
AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
return;
}
-const char* GetARversion(){
- // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
- // It's the best we can do without a GetVersion() method
- TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
- Int_t size = fv->GetSize();
- char *buf = new Char_t[size];
- memset(buf, '\0', size);
- fv->Seek(0);
- const char* alirootv;
- if ( fv->ReadBuffer(buf, size) ) {
- Printf("Error reading AliRoot version from file to buffer!");
- alirootv = "";
- }
- if(buf=="AliRoot"){
- alirootv="HEAD";
- }else{
- alirootv = buf;
- }
- return alirootv;
-}
-const char* GetARversion();
-
-void MakeAllDETsResMisAlignment(Char_t* CDBstorage = "local://$HOME/Residual"){
+void MakeAllDETsResMisAlignment(Char_t* CDBstorage = "local://$HOME/ResidualMisAlignment", Bool_t partialGeom=kFALSE){
// Make residual misalignment objects for all detectors
// Pass different "CDBstorage" argument if needed (e.g. to fill
// conditions' data base on alien) or set it to null string to have
}else{
gSystem->Setenv("TOCDB","kTRUE");
gSystem->Setenv("STORAGE",strStorage.Data());
+ gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
gSystem->Setenv("ARVERSION",GetARversion());
}
+ if(partialGeom){
+ gSystem->Setenv("PARTGEOM","kTRUE");
+ }else{
+ gSystem->Setenv("PARTGEOM","kFALSE");
+ }
// Load geometry from CDB updating it if we are producing the
// alignment objects for the CDB
// update geometry in it
Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
- UpdateCDBIdealGeom(strStorage.Data());
+ if(partialGeom){
+ UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
+ }else{
+ UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");
+ }
// load the same geometry from given CDB storage
AliCDBPath path("GRP","Geometry","Data");
AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
return;
}
-const char* GetARversion(){
- // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
- // It's the best we can do without a GetVersion() method
- TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
- Int_t size = fv->GetSize();
- char *buf = new Char_t[size];
- memset(buf, '\0', size);
- fv->Seek(0);
- const char* alirootv;
- if ( fv->ReadBuffer(buf, size) ) {
- Printf("Error reading AliRoot version from file to buffer!");
- alirootv = "";
- }
- if(buf=="AliRoot"){
- alirootv="HEAD";
- }else{
- alirootv = buf;
- }
- return alirootv;
-}
-const char* GetARversion();
-
-void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
+void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/ZeroMisAlignment", Bool_t partialGeom=kFALSE){
// Make zero misalignment objects for all detectors
// Pass different "CDBstorage" argument if needed (e.g. to fill
// conditions' data base on alien) or set it to null string to have
}else{
gSystem->Setenv("TOCDB","kTRUE");
gSystem->Setenv("STORAGE",strStorage.Data());
+ gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C");
gSystem->Setenv("ARVERSION",GetARversion());
}
+ if(partialGeom){
+ gSystem->Setenv("PARTGEOM","kTRUE");
+ }else{
+ gSystem->Setenv("PARTGEOM","kFALSE");
+ }
// Load geometry from CDB updating it if we are producing the
// alignment objects for the CDB
// update geometry in it
Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
+ if(partialGeom){
+ UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
+ }else{
UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");
+ }
// load the same geometry from given CDB storage
AliCDBPath path("GRP","Geometry","Data");
AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
return;
}
-const char* GetARversion(){
- // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
- // It's the best we can do without a GetVersion() method
- TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
- Int_t size = fv->GetSize();
- char *buf = new Char_t[size];
- memset(buf, '\0', size);
- fv->Seek(0);
- const char* alirootv;
- if ( fv->ReadBuffer(buf, size) ) {
- Printf("Error reading AliRoot version from file to buffer!");
- alirootv = "";
- }
- if(buf=="AliRoot"){
- alirootv="HEAD";
- }else{
- alirootv = buf;
- }
- return alirootv;
-}