// null shifts and rotations
const TString basepath = "EMCAL/FullSupermodule";
+ const TString hbasepath = "EMCAL/HalfSupermodule";
TString pathstr;
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex); //dummy volume identity
Int_t i;
+ Int_t j=0;
for(i=0; i<10; i++){
-
dx = rnd->Gaus(0.,sigmatr);
dy = rnd->Gaus(0.,sigmatr);
dz = rnd->Gaus(0.,sigmatr);
pathstr=basepath;
pathstr+=(i+1);
cout<<pathstr<<" "<<dx<<" "<<dy<<" "<<dz<<" "<<dpsi<<" "<<dtheta<<" "<<dphi<<"\n";
- new(alobj[i]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+ new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+ }
+
+ for(i=0; i<2; i++){
+ dx = rnd->Gaus(0.,sigmatr);
+ dy = rnd->Gaus(0.,sigmatr);
+ dz = rnd->Gaus(0.,sigmatr);
+ dpsi = rnd->Gaus(0.,sigmarot);
+ dtheta = rnd->Gaus(0.,sigmarot);
+ dphi = rnd->Gaus(0.,sigmarot);
+ pathstr=hbasepath;
+ pathstr+=(i+1);
+ new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
if(!gSystem->Getenv("$TOCDB")){
Double_t dx, dy, dz, dpsi, dtheta, dphi;
const TString basepath = "EMCAL/FullSupermodule";
+ const TString hbasepath = "EMCAL/HalfSupermodule";
TString pathstr;
Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
Int_t i;
+ Int_t j=0;
// RS = local
// sigma translation = 1mm
TRandom *rnd = new TRandom(4321);
Double_t sigmatr = 0.1; // max shift in cm w.r.t. local RS
Double_t sigmarot = 0.1; // max rot in degrees w.r.t. local RS
+
for(i=0; i<10; i++){
dx = rnd->Gaus(0.,sigmatr);
dy = rnd->Gaus(0.,sigmatr);
dphi = rnd->Gaus(0.,sigmarot);
pathstr=basepath;
pathstr+=(i+1);
- new(alobj[i]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+ new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+ }
+
+ for(i=0; i<2; i++){
+ dx = rnd->Gaus(0.,sigmatr);
+ dy = rnd->Gaus(0.,sigmatr);
+ dz = rnd->Gaus(0.,sigmatr);
+ dpsi = rnd->Gaus(0.,sigmarot);
+ dtheta = rnd->Gaus(0.,sigmarot);
+ dphi = rnd->Gaus(0.,sigmarot);
+ pathstr=hbasepath;
+ pathstr+=(i+1);
+ new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
if(!gSystem->Getenv("$TOCDB")){
--- /dev/null
+void MakeEMCALZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for EMCAL
+ //
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray &alobj = *array;
+
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ AliAlignObjAngles a;
+
+ Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+
+ const TString fbasepath = "EMCAL/FullSupermodule";
+ const TString hbasepath = "EMCAL/HalfSupermodule";
+ TString pathstr;
+
+ Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+ Int_t i;
+ Int_t j=0;
+
+ for(i=0; i<10; i++){
+ pathstr=fbasepath;
+ pathstr+=(i+1);
+ new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
+
+ for(i=0; i<2; i++){
+ pathstr=hbasepath;
+ pathstr+=(i+1);
+ new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("EMCALzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Jennifer Clay");
+ md->SetComment("Zero misalignment for EMCAL");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("EMCAL/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
--- /dev/null
+void MakeFMDZeroMisAlignment()
+{
+ // Create TClonesArray of zero-misalignment objects for FMD
+ //
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+
+ gSystem->Load("libFMDutil.so");
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDAlignObjs.root");
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage);
+ }
+
+ // fRunMax should be changed in the constructor
+
+ faker.SetSensorDisplacement(0., 0., 0., 0., 0., 0.);
+ faker.SetSensorRotation(0., 0., 0., 0., 0., 0.);
+ faker.SetHalfDisplacement(0., 0., 0., 0., 0., 0.);
+ faker.SetHalfRotation(0., 0., 0., 0., 0., 0.);
+ faker.Exec();
+
+
+}
--- /dev/null
+void MakeHMPIDZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for HMPID
+ //
+ TClonesArray *pCA = new TClonesArray("AliAlignObjMatrix",10);
+
+ AliAlignObjMatrix o;
+
+ Double_t dX=0.,dY=0.,dZ=0.,dPsi=0.,dTheta=0.,dPhi=0.;
+
+ Int_t idHMPID = AliAlignObj::kHMPID;
+ for (Int_t iCh = 0; iCh < 7; iCh++) {
+ new((*pCA)[iCh]) AliAlignObjMatrix(AliAlignObj::SymName(idHMPID,iCh),AliAlignObj::LayerToVolUID(idHMPID,iCh),dX,dY,dZ,dPsi,dTheta,dPhi,kTRUE);
+ }
+
+// pCA->Print();
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("HMPIDzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(pCA,"HMPIDAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData *pMeta= new AliCDBMetaData();
+ pMeta->SetResponsible("HMPID Expert");
+ pMeta->SetComment("Zero alignment objects for HMPID");
+ pMeta->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("HMPID/Align/Data",0,9999999);
+ storage->Put(pCA,id,pMeta);
+ }
+
+ pCA->Delete();
+}
Int_t j = 0;
new(alobj[j++]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
+ AliAlignObjAngles* its_alobj = (AliAlignObjAngles*) array->UncheckedAt(0);
+ its_alobj->ApplyToGeometry();
for ( Int_t l = AliAlignObj::kSPD1; l <= AliAlignObj::kSSD2; l++) {
Int_t j = 0;
- new(alobj[j]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
- j++;
+ new(alobj[j++]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
+ AliAlignObjAngles* its_alobj = (AliAlignObjAngles*) array->UncheckedAt(0);
+ its_alobj->ApplyToGeometry();
+
for ( Int_t l = AliAlignObj::kSPD1; l <= AliAlignObj::kSSD2; l++) {
--- /dev/null
+void MakeITSZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for ITS
+ //
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",4000);
+ TClonesArray &alobj = *array;
+
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ AliAlignObjAngles a;
+
+ Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0., globalZ=0.;
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+
+ Int_t j = 0;
+
+ new(alobj[j]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
+ j++;
+
+ for ( Int_t l = AliAlignObj::kSPD1; l <= AliAlignObj::kSSD2; l++) {
+
+ printf("%i modules in layer %i\n", AliAlignObj::LayerSize(l), l);
+ for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(l); iModule++) {
+
+ iLayer = AliAlignObj::kInvalidLayer;
+
+ switch (l) {
+ case 1: {
+ iLayer = AliAlignObj::kSPD1;
+ }; break;
+ case 2: {
+ iLayer = AliAlignObj::kSPD2;
+ }; break;
+ case 3: {
+ iLayer = AliAlignObj::kSDD1;
+ }; break;
+ case 4: {
+ iLayer = AliAlignObj::kSDD2;
+ }; break;
+ case 5: {
+ iLayer = AliAlignObj::kSSD1;
+ }; break;
+ case 6: {
+ iLayer = AliAlignObj::kSSD2;
+ }; break;
+ default: Printf("Wrong layer index in ITS (%d) !",l);
+ };
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
+ const char *symname = AliAlignObj::SymName(volid);
+
+ new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ j++;
+
+ }
+ }
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("ITSzeroMisalignment.root","RECREATE");
+ if(!f) {cerr<<"cannot open file for output\n";}
+ f.WriteObject(array,"ITSAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager *CDB = AliCDBManager::Instance();
+ AliCDBStorage* storage = CDB->GetStorage(Storage);
+ AliCDBMetaData *md= new AliCDBMetaData();
+ md->SetResponsible("Ludovic Gaudichet");
+ md->SetComment("Alignment objects with zero ITS misalignment");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("ITS/Align/Data",0,9999999);
+ storage->Put(array,id, md);
+ }
+
+ array->Delete();
+
+}
+
+
--- /dev/null
+void MakeMUONZeroMisAlignment(Bool_t volpaths = false,
+ Bool_t transforms = false,
+ Bool_t svmaps = false)
+// Macro for generating the geometry data files:
+// (volpath.dat, transform.dat, svmap.dat)
+// and local CDB storage with zero, residual and full misalignment
+//
+// The generated files do not replace the existing ones
+// but have different names (with extension ".out").
+//
+// Author: I. Hrivnacova, IPN Orsay
+//
+{
+ // Initialize
+ gAlice->Init("$ALICE_ROOT/MUON/Config.C");
+ cout << "Init done " << endl;
+
+ // Get MUON detector
+ AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
+ if (!muon) {
+ AliFatal("MUON detector not defined.");
+ return 0;
+ }
+
+ // Get geometry builder
+ AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder();
+
+ if (volpaths) {
+ cout << "Generating volpath file ..." << endl;
+ builder->GetTransformer()->WriteVolumePaths("volpath.dat.out");
+ }
+
+ if (transforms) {
+ cout << "Generating transformation file ..." << endl;
+ builder->GetTransformer()->WriteTransformations("transform.dat.out");
+ }
+
+ if (svmaps) {
+ cout << "Generating svmaps file ..." << endl;
+ builder->WriteSVMaps();
+ }
+
+ cout << "Generating residual misalignment data in MUON/ZeroMisAlignCDB/Data..." << endl;
+
+ AliMUONGeometryMisAligner misAligner(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+ AliMUONGeometryTransformer* newTransform
+ = misAligner.MisAlign(builder->GetTransformer(), true);
+ TClonesArray* array = newTransform->GetMisAlignmentData();
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // Create a File to store the alignment data
+ TFile f("MUONresidualMisalignment.root","RECREATE");
+ if(!f) {cerr<<"cannot open file for output\n";}
+
+ f.cd();
+ f.WriteObject(array,"MUONAlignObjs ","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdbManager = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdbManager->GetStorage(Storage);
+ AliCDBMetaData* cdbData = new AliCDBMetaData();
+ cdbData->SetResponsible("Dimuon Offline project");
+ cdbData->SetComment("MUON alignment objects with residual misalignment");
+ cdbData->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("MUON/Align/Data", 0, 9999999);
+ storage->Put(array, id, cdbData);
+ }
+
+ delete newTransform;
+}
+
--- /dev/null
+void MakePHOSZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for PHOS
+ //
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",11);
+ TClonesArray &alobj = *array;
+
+ AliAlignObjAngles a;
+
+ Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+
+ Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+ // Alignment for 5 PHOS modules
+ new(alobj[0]) AliAlignObjAngles("PHOS/Module1",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[1]) AliAlignObjAngles("PHOS/Module2",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[2]) AliAlignObjAngles("PHOS/Module3",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[3]) AliAlignObjAngles("PHOS/Module4",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[4]) AliAlignObjAngles("PHOS/Module5",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+ // Alignment for PHOS cradle
+ new(alobj[5]) AliAlignObjAngles("PHOS/Cradle0",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[6]) AliAlignObjAngles("PHOS/Cradle1",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+ // Alignment for cradle wheels
+ new(alobj[7]) AliAlignObjAngles("PHOS/Wheel0",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[8]) AliAlignObjAngles("PHOS/Wheel1",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[9]) AliAlignObjAngles("PHOS/Wheel2",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[10]) AliAlignObjAngles("PHOS/Wheel3",
+ volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("PHOSzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"PHOSAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager *CDB = AliCDBManager::Instance();
+ AliCDBStorage* storage = CDB->GetStorage(Storage);
+ AliCDBMetaData *md= new AliCDBMetaData();
+ md->SetResponsible("Yuri Kharlov");
+ md->SetComment("Zero misalignment objects");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("PHOS/Align/Data",0,9999999);
+ storage->Put(array,id, md);
+ }
+
+ array->Delete();
+
+}
Float_t max_rot=0.1;
TString path;
- const char *Sector1="/ALIC_1/EPM1_1";
- const char *Sector2="/ALIC_1/EPM2_1";
- const char *Sector3="/ALIC_1/EPM3_1";
- const char *Sector4="/ALIC_1/EPM4_1";
+ const char *Sector1="PMD/Sector1";
+ const char *Sector2="PMD/Sector2";
+ const char *Sector3="PMD/Sector3";
+ const char *Sector4="PMD/Sector4";
//Sectors 1 and 4
Float_t max_rot=0.1;
TString path;
- const char *Sector1="/ALIC_1/EPM1_1";
- const char *Sector2="/ALIC_1/EPM2_1";
- const char *Sector3="/ALIC_1/EPM3_1";
- const char *Sector4="/ALIC_1/EPM4_1";
+ const char *Sector1="PMD/Sector1";
+ const char *Sector2="PMD/Sector2";
+ const char *Sector3="PMD/Sector3";
+ const char *Sector4="PMD/Sector4";
//Sectors 1 and 4
--- /dev/null
+void MakePMDZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for PMD
+ //
+ // Macro to randomly displace the 4 sectors of the PMD
+ // in each plane. Each sector (to be misaligned)
+ // of PMD houses the following :
+ // (a) 6 modules of preshower plane
+ // (b) 6 modules of veto plane
+ // (c) The FEE boards on back plane of each module
+ // (d) 6 modules of convertor plates
+ // The clustering is done module-wise
+ // The actual amount displacement will be provided
+ // by the survey data and has to be converted into
+ // displacement in x,y,z,theta, phi and psi
+
+
+ // Now specify the path of the module to be misaligned
+ // as followed in the PMD geant
+
+ /*
+ _____________
+ | | |
+ | 1 | 3 |
+ | |________|
+ |____|___| |
+ | | 2 |
+ | 4 | |
+ |________|____|
+
+ // Misalignment Matrix is expected to be
+ // same for sectors 1 and 4
+ // and for the sectors 2 and 3
+ // As these will be mounted on the same
+ // Steel plate
+ */
+
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ //Create a TClonesArray of Align Object to store displacement Angles
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray &alobj = *array;
+
+ AliAlignObjAngles o;
+
+ Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+ Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+ Int_t i, j=0;
+
+ for(i=1; i<=4; i++){
+ TString snSector(Form("PMD/Sector%d",i));
+ new(alobj[j++]) AliAlignObjAngles(snSector.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // Create a File to store the alignment data
+ TFile f("PMDzeroMisalignment.root","RECREATE");
+ if(!f) {cerr<<"cannot open file for output\n";}
+
+ f.cd();
+ f.WriteObject(array,"PMDAlignObjs ","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("");
+ md->SetComment("Zero misalignment for PMD");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("PMD/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+ array->Delete();
+
+}
void MakeT0FullMisAlignment(){
// Create TClonesArray of full misalignment objects for T0
//
- TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
TClonesArray &alobj = *array;
if(!gGeoManager) TGeoManager::Import("geometry.root");
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
- Double_t sigmatr = 0.05; // max shift in cm w.r.t. RS
- Double_t sigmarot = 0.3; // max rot in degrees w.r.t. RS
+ Double_t sigmatr = 0.05; // sigma for shifts in cm
+ Double_t sigmarot = 0.3; // sigma for tilts in degrees
- // null shifts and rotations
+ TString symName, sn;
- const char *T0right="/ALIC_1/0STR_1";
- const char *T0left="/ALIC_1/0STL_1";
-
- Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
+ Int_t iIndex=0;
AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
- dx = rnd->Gaus(0.,sigmatr);
- dy = rnd->Gaus(0.,sigmatr);
- dz = rnd->Gaus(0.,sigmatr);
- dpsi = rnd->Gaus(0.,sigmarot);
- dtheta = rnd->Gaus(0.,sigmarot);
- dphi = rnd->Gaus(0.,sigmarot);
- cout<<dx<<" "<<dy<<" "<<dz<<" "<<dpsi<<" "<<dtheta<<" "<<dphi<<"\n";
- new(alobj[0]) AliAlignObjAngles(T0right, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
- dx = rnd->Gaus(0.,sigmatr);
- dy = rnd->Gaus(0.,sigmatr);
- dz = rnd->Gaus(0.,sigmatr);
- dpsi = rnd->Gaus(0.,sigmarot);
- dtheta = rnd->Gaus(0.,sigmarot);
- dphi = rnd->Gaus(0.,sigmarot);
- cout<<dx<<" "<<dy<<" "<<dz<<" "<<dpsi<<" "<<dtheta<<" "<<dphi<<"\n";
- new(alobj[1]) AliAlignObjAngles(T0left, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-
- // just save in a file you will send me
- // or you will put in your afs public dir ...
-
+ Int_t j=0;
+ for (Int_t imod=0; imod<24; imod++){
+ if (imod < 12){
+ sn="T0/C/PMT";
+ }else{
+ sn="T0/A/PMT";
+ }
+ symName = sn;
+ symName += imod+1;
+
+ dx = rnd->Gaus(0.,sigmatr);
+ dy = rnd->Gaus(0.,sigmatr);
+ dz = rnd->Gaus(0.,sigmatr);
+ dpsi = rnd->Gaus(0.,sigmarot);
+ dtheta = rnd->Gaus(0.,sigmarot);
+ dphi = rnd->Gaus(0.,sigmarot);
+
+ new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
+
if(!gSystem->Getenv("$TOCDB")){
// save on file
TFile f("T0fullMisalignment.root","RECREATE");
}else{
// save in CDB storage
const char* Storage = gSystem->Getenv("$STORAGE");
- // save in CDB storage
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBStorage* storage = cdb->GetStorage(Storage);
AliCDBMetaData* md = new AliCDBMetaData();
void MakeT0ResMisAlignment(){
// Create TClonesArray of residual misalignment objects for T0
//
- TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
TClonesArray &alobj = *array;
if(!gGeoManager) TGeoManager::Import("geometry.root");
Double_t sigmatr = 0.05; // max shift in cm
Double_t sigmarot = 0.3; // max rot in degrees
- const char *T0right="/ALIC_1/0STR_1";
- const char *T0left="/ALIC_1/0STL_1";
+ TString symName, sn;
Int_t iIndex=0;
AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
- dx = rnd->Gaus(0.,sigmatr);
- dy = rnd->Gaus(0.,sigmatr);
- dz = rnd->Gaus(0.,sigmatr);
- dpsi = rnd->Gaus(0.,sigmarot);
- dtheta = rnd->Gaus(0.,sigmarot);
- dphi = rnd->Gaus(0.,sigmarot);
- cout<<dx<<" "<<dy<<" "<<dz<<" "<<dpsi<<" "<<dtheta<<" "<<dphi<<"\n";
- new(alobj[0]) AliAlignObjAngles(T0right, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
- dx = rnd->Gaus(0.,sigmatr);
- dy = rnd->Gaus(0.,sigmatr);
- dz = rnd->Gaus(0.,sigmatr);
- dpsi = rnd->Gaus(0.,sigmarot);
- dtheta = rnd->Gaus(0.,sigmarot);
- dphi = rnd->Gaus(0.,sigmarot);
- cout<<dx<<" "<<dy<<" "<<dz<<" "<<dpsi<<" "<<dtheta<<" "<<dphi<<"\n";
- new(alobj[1]) AliAlignObjAngles(T0left, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-
+ Int_t j=0;
+ for (Int_t imod=0; imod<24; imod++){
+ if (imod < 12){
+ sn="T0/C/PMT";
+ }else{
+ sn="T0/A/PMT";
+ }
+ symName = sn;
+ symName += imod+1;
+
+ dx = rnd->Gaus(0.,sigmatr);
+ dy = rnd->Gaus(0.,sigmatr);
+ dz = rnd->Gaus(0.,sigmatr);
+ dpsi = rnd->Gaus(0.,sigmarot);
+ dtheta = rnd->Gaus(0.,sigmarot);
+ dphi = rnd->Gaus(0.,sigmarot);
+
+ new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
+
if(!gSystem->Getenv("$TOCDB")){
// save on file
TFile f("T0residualMisalignment.root","RECREATE");
--- /dev/null
+void MakeT0ZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for T0
+ //
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray &alobj = *array;
+
+ AliAlignObjAngles a;
+
+ Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
+
+ TString symName, sn;
+
+ Int_t iIndex=0;
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+ Int_t j=0;
+ for (Int_t imod=0; imod<24; imod++)
+ {
+ if (imod < 12){
+ sn="T0/C/PMT";
+ }else{
+ sn="T0/A/PMT";
+ }
+ symName = sn;
+ symName += imod+1;
+
+ new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ }
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("T0zeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"T0ZeroObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Tomasz Malkiewicz");
+ md->SetComment("Zero misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("T0/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
void MakeTOFFullMisAlignment(){
// Create TClonesArray of full misalignment objects for TOF
//
- TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root"); //needed for
- // the constructors with local coordinates not to fail
+ if(!gGeoManager) TGeoManager::Import("/home/rgrosso/Prove/AliRoot/geometry.root");
AliAlignObjAngles a;
-
- Int_t nSMTOF = 18;
+ Double_t sfdpsi=0.,sfdtheta=0.,sfdphi=0.;
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
- UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+ UShort_t dvoluid = AliAlignObj::LayerToVolUID(iLayer,iIndex); //dummy vol id
+
+ // FRAME part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ const char* basepath ="ALIC_1/B077_1/BSEGMO";
+ TString segmpath;
+
+ // for dead weight !!!! carefull: in mm
+ ifstream dw_file("/home/rgrosso/MacroAllineamento010207/disp_deadweight.txt", ios::in);
+ if(!dw_file) {cerr<<"cannot open dead weight file for input\n"; return;}
+ TArrayD dwdx(36);
+ TArrayD dwdy(36);
+ TArrayD dwdz(36);
+ TArrayD dwdrot(36);
+ // for additional load
+ ifstream orig_file("/home/rgrosso/MacroAllineamento010207/disp_full.txt", ios::in);
+// ifstream orig_file("disp_full_nohmpid.txt", ios::in);
+ if(!orig_file) {cerr<<"cannot open file for input\n"; return;}
+ TArrayD adx(36);
+ TArrayD ady(36);
+ TArrayD adz(36);
+ TArrayD adrot(36);
+ // avarage displacements
+ Double_t mean_dx[18];
+ Double_t mean_dy[18];
+ Double_t idx[18];
+ Double_t idy[18];
+ Double_t newx[18];
+ Double_t newy[18];
+
+ string buffer;
+ Int_t point;
+ Double_t dx,dy,dz,drot;
+
+ // fill in from file the array for dead weight deformations
+ dw_file>>point>>dx>>dy>>dz>>drot;
+ dwdx.AddAt(dx,point-1);dwdy.AddAt(dy,point-1);dwdz.AddAt(dz,point-1);dwdrot.AddAt(drot,point-1);
+ while(getline(dw_file,buffer))
+ {
+ dw_file>>point>>dx>>dy>>dz>>drot;
+ dwdx.AddAt(dx,point-1);dwdy.AddAt(dy,point-1);dwdz.AddAt(dz,point-1);dwdrot.AddAt(drot,point-1);
+ }
+
+ // fill in from file the array for remaining load deformations
+ orig_file>>point>>dx>>dy>>dz>>drot;
+ adx.AddAt(dx,point-1);ady.AddAt(dy,point-1);adz.AddAt(dz,point-1);adrot.AddAt(drot,point-1);
+ while(getline(orig_file,buffer))
+ {
+ orig_file>>point>>dx>>dy>>dz>>drot;
+ adx.AddAt(dx,point-1);ady.AddAt(dy,point-1);adz.AddAt(dz,point-1);adrot.AddAt(drot,point-1);
+ }
+
+ //calculate the displacement of the center of the sm neglecting rotations,
+ //thus as average of the four surrounding point for dw + other load
+ // Prepare also to plot with respect to ideal circle.
+ Double_t cx=0.5; //just for plotting
+ Double_t cy=0.5;
+ Double_t rr=0.3;
+ Double_t kk = TMath::Pi()*20./180.;
+ Double_t scale = 100./4000.;
+ TPolyMarker* iddu = new TPolyMarker(18,newx,newy);
+ TPolyMarker* disp = new TPolyMarker(18,newx,newy);
+
+ Int_t sm,outc,outclw; //outer number counterclock and clockwise
+ for(sm=0; sm<18; sm++){
+ outc=5-sm;
+ if(outc<1) outc+=18;
+ outclw=outc-1;
+ if(outclw<1) outclw+=18;
+ mean_dx[sm]=0.125*(adx[outc-1]+adx[outclw-1]+adx[outc+18-1]+adx[outclw+18-1]+dwdx[outc-1]+dwdx[outclw-1]+dwdx[outc+18-1]+dwdx[outclw+18-1]);
+ mean_dy[sm]=0.125*(ady[outc-1]+ady[outclw-1]+ady[outc+18-1]+ady[outclw+18-1]+dwdy[outc-1]+dwdy[outclw-1]+dwdy[outc+18-1]+dwdy[outclw+18-1]);
+ idx[sm]=cx+rr*TMath::Sin(sm*kk);
+ idy[sm]=cy+rr*TMath::Cos(sm*kk);
+ newx[sm]=idx[sm]+scale*mean_dx[sm];
+ newy[sm]=idy[sm]+scale*mean_dy[sm];
+ iddu->SetPoint(sm,idx[sm],idy[sm]);
+ disp->SetPoint(sm,newx[sm],newy[sm]);
+
+ segmpath=basepath;
+ segmpath+=sm;
+ segmpath+="_1";
+ cout<<segmpath.Data()<<" "<<dvoluid<<" "<<mean_dx[sm]*0.1<<" "<<mean_dy[sm]*0.1<<" "<<dz<<" "<<sfdpsi<<" "<<sfdtheta<<" "<<sfdphi<<endl;
+ new(alobj[sm]) AliAlignObjAngles(segmpath.Data(), dvoluid, mean_dx[sm]*0.1,
+ mean_dy[sm]*0.1, dz, sfdpsi, sfdtheta, sfdphi, kTRUE);
+ }
+ for(Int_t k=0; k<18; k++){
+ AliAlignObjAngles* smobj = (AliAlignObjAngles*)array->UncheckedAt(k);
+ if(!smobj->ApplyToGeometry()){
+ cout<<"application of object "<<k<<" failed!"<<endl;
+ return;
+ }
+ }
+ gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root");
+ gGeoManager=0x0;
+ TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root");
+
+ // TOF part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ Int_t nSMTOF = 18;
Int_t i;
- Int_t j=0;
- Double_t dx, dy, dz, dpsi, dtheta, dphi;
+ Int_t j=18;
+ Double_t tofdx, tofdy, tofdz, dpsi, dtheta, dphi;
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(i=0; i<18; i++) {
- Char_t path[100];
- sprintf(path,"TOF/sm%02d",i);
- dx = rnd->Gaus(0.,sigmatr);
- dy = 0;
- dz = rnd->Gaus(0.,sigmatr);
+ TString symname(Form("TOF/sm%02d",i));
+ tofdx = rnd->Gaus(0.,sigmatr);
+ tofdy = 0;
+ tofdz = rnd->Gaus(0.,sigmatr);
dpsi = 0;
dtheta = rnd->Gaus(0.,sigmarot);
dphi = 0.;
- new(alobj[j]) AliAlignObjAngles(path, volid, dx, dy, dz, dpsi, dtheta, dphi,kFALSE);
- alobj[j]->Print();
- j++;
+ new(alobj[j++]) AliAlignObjAngles(symname.Data(), dvoluid, tofdx, tofdy, tofdz, dpsi, dtheta, dphi, kFALSE);
+ }
+ for(Int_t k=18; k<36; k++){
+ AliAlignObjAngles* smobj = (AliAlignObjAngles*)array->UncheckedAt(k);
+ if(!smobj->ApplyToGeometry()){
+ cout<<"application of object "<<k<<" failed!"<<endl;
+ return;
+ }
+ }
+ gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_tofSM.root");
+
+
+ gGeoManager=0x0;
+ TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_tofSM.root");
+ // tof strips as in residual
+ AliAlignObj::ELayerID idTOF = AliAlignObj::kTOF;
+
+ Double_t sdx=0.;
+ Double_t sdy=0.;
+ Double_t sdz=0.;
+ Double_t sdpsi, sdtheta, sdphi;
+ TRandom *rnds = new TRandom(4357);
+ sigmatr = 0.1; // max shift in cm w.r.t. local ideal RS
+
+ for(i=0; i<AliAlignObj::LayerSize(idTOF); i++) {
+ sdx = 0;
+ sdy = rnds->Gaus(0.,sigmatr);
+ sdz = rnds->Gaus(0.,sigmatr);
+ sdpsi = 0.;
+ sdtheta = 0.;
+ sdphi = 0.;
+ new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i), AliAlignObj::LayerToVolUID(idTOF,i), sdx, sdy, sdz, sdpsi, sdtheta, sdphi, kFALSE);
}
if(!gSystem->Getenv("$TOCDB")){
AliCDBStorage* storage = cdb->GetStorage(Storage);
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Silvia Arcelli");
- md->SetComment("Full misalignment for TOF");
+ md->SetComment("Full misalignment for TOF and FRAME");
md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
AliCDBId id("TOF/Align/Data",0,9999999);
storage->Put(array,id,md);
TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!gGeoManager) TGeoManager::Import("/home/rgrosso/Prove/AliRoot/geometry.root");
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
void MakeTOFZeroMisAlignment(){
-
// Create TClonesArray of zero misalignment objects for TOF
-
+ //
TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
TClonesArray &alobj = *array;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
for(i=0; i<AliAlignObj::LayerSize(idTOF); i++) {
- // cout << " TOF symname : " << AliAlignObj::SymName(idTOF,i) << endl;
- new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i),
- AliAlignObj::LayerToVolUID(idTOF,i),
- dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i), AliAlignObj::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- // save in CDB storage
- const char* Storage = "local://$ALICE_ROOT";
- AliCDBManager* cdb = AliCDBManager::Instance();
- AliCDBStorage* storage = cdb->GetStorage(Storage);
- AliCDBMetaData* md = new AliCDBMetaData();
- md->SetResponsible("Silvia Arcelli");
- md->SetComment("Zero misalignment for TOF");
- md->SetAliRootVersion("HEAD");
- AliCDBId id("TOF/Align/Data",0,9999999);
- storage->Put(array,id,md);
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("TOFzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"TOFAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Silvia Arcelli");
+ md->SetComment("Zero misalignment for TOF");
+ md->SetAliRootVersion("HEAD");
+ AliCDBId id("TOF/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
array->Delete();
TRandom *rnd = new TRandom(4357);
AliAlignObjAngles o;
Int_t j = 0;
+ Double_t dx, dy, dz, dpsi, dtheta, dphi;
+
// RS = local
- // sigma translation = 1mm
- // sigma rotation = 1mrad
+ // sigma translation = 0.1 mm
+ // sigma rotation = 0.1 mrad
Float_t sigmatr=0.01;
- Float_t sigmarot = 0.06;
+ Float_t sigmarot = 0.006;
+
for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
- Double_t dx = (rnd->Uniform()-0.5)*sigmatr;
- Double_t dy = (rnd->Uniform()-0.5)*sigmatr;
- Double_t dz = (rnd->Uniform()-0.5)*sigmatr;
- Double_t dpsi = (rnd->Uniform()-0.5)*sigmarot;
- Double_t dtheta = (rnd->Uniform()-0.5)*sigmarot;
- Double_t dphi = (rnd->Uniform()-0.5)*sigmarot;
+ dx = (rnd->Uniform()-0.5)*sigmatr;
+ dy = (rnd->Uniform()-0.5)*sigmatr;
+ dz = (rnd->Uniform()-0.5)*sigmatr;
+ dpsi = (rnd->Uniform()-0.5)*sigmarot;
+ dtheta = (rnd->Uniform()-0.5)*sigmarot;
+ dphi = (rnd->Uniform()-0.5)*sigmarot;
UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
const char *symname = AliAlignObj::SymName(volid);
- new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
- j++;
+ new(alobj[j++]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
}
}
Int_t j = 0;
// RS = local
- // sigma translation = 0.1mm
- // sigma rotation = 1mrad
+ // sigma translation = 0.1 mm
+ // sigma rotation = 0.1 mrad
Float_t sigmatr=0.01;
- Float_t sigmarot = 0.06;
+ Float_t sigmarot = 0.006;
for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
--- /dev/null
+void MakeTPCZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for TPC
+ //
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
+ TClonesArray &alobj = *array;
+
+ AliAlignObjAngles o;
+ Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+ Int_t j = 0;
+
+ // RS = local
+ for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
+ for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
+
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
+ const char *symname = AliAlignObj::SymName(volid);
+ new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ j++;
+ }
+ }
+
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("TPCzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"TPCAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Marian Ivanov");
+ md->SetComment("Zero misalignment for TPC");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("TPC/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
- // needed for the constructors with local coordinates not to fail
-
AliAlignObjAngles a;
+ // sigmas for the supermodules
+ Double_t smdx=0.3; // 3 mm
+ Double_t smdy=0.3; // 3 mm
+ Double_t smdz=0.3; // 3 mm
+ Double_t smrx=0.4/1000/TMath::Pi()*180; // 0.4 mrad
+ Double_t smry=2.0/1000/TMath::Pi()*180; // 2 mrad
+ Double_t smrz=0.4/1000/TMath::Pi()*180; // 0.4 mrad
+
+
// sigmas for the chambers
- Double_t chdx=1; // 1 cm
- Double_t chdy=1; // 1 cm
- Double_t chdz=1; // 1 cm
+ Double_t chdx=0.1; // 1 mm
+ Double_t chdy=0.1; // 1 mm
+ Double_t chdz=0.1; // 1 mm
Double_t chrx=1.0/1000/TMath::Pi()*180; // 1 mrad
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 j=0;
TRandom *ran = new TRandom(4357);
UShort_t volid;
- const char *path;
+ const char *symname;
+
+ TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root"); // geometry where the BSEGMO volumes have been misaligned
+ // create the supermodules' alignment objects
+ for (int i; i<18; i++) {
+ TString sm_symname(Form("TRD/sm%02d",i));
+ ran->Rannor(dx,rx);
+ ran->Rannor(dy,ry);
+ ran->Rannor(dz,rz);
+ dx*=smdx;
+ dy*=smdy;
+ dz*=smdz;
+ rx*=smrx;
+ ry*=smry;
+ rz*=smrz;
+ new(alobj[j++]) AliAlignObjAngles(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
+ }
+
+ for(Int_t k=0; k<18; k++){
+ AliAlignObjAngles* smobj = (AliAlignObjAngles*)array->UncheckedAt(k);
+ if(!smobj->ApplyToGeometry()){
+ cout<<"application of object "<<k<<" failed!"<<endl;
+ return;
+ }
+ }
+ gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_trdSM.root");
+ gGeoManager=0x0;
+ TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_trdSM.root");
// create the chambers' alignment objects
+ ran = new TRandom(4357);
for (Int_t iLayer = AliAlignObj::kTRD1; iLayer <= AliAlignObj::kTRD6; iLayer++) {
for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
- ran.Rannor(dx,rx);
- ran.Rannor(dy,ry);
- ran.Rannor(dz,rz);
+ ran->Rannor(dx,rx);
+ ran->Rannor(dy,ry);
+ ran->Rannor(dz,rz);
dx*=chdx;
dy*=chdy;
dz*=chdz;
AliAlignObjAngles a;
// sigmas for the chambers
- Double_t chdx=0.02; // 200 microns
- Double_t chdy=0.03; // 300 microns
- Double_t chdz=0.07; // 700 microns
+ 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.3/1000/TMath::Pi()*180; // 0.3 mrad
Double_t chry=0.3/1000/TMath::Pi()*180; // 0.3 mrad
Double_t chrz=0.1/1000/TMath::Pi()*180; // 0.1 mrad
--- /dev/null
+void MakeTRDZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for TRD
+ //
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
+ TClonesArray &alobj = *array;
+
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ AliAlignObjAngles a;
+
+ 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 chambers' alignment objects
+ for (Int_t iLayer = AliAlignObj::kTRD1; iLayer <= AliAlignObj::kTRD6; iLayer++) {
+ for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
+ volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
+ symname = AliAlignObj::SymName(volid);
+ new(alobj[j++]) AliAlignObjAngles(symname,volid,dx,dy,dz,rx,ry,rz,kTRUE);
+ }
+ }
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("TRDzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"TRDAlignObjs","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Dariusz Miskowiec");
+ md->SetComment("Zero misalignment for TRD");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("TRD/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
+
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
- Double_t sigmatr = 0.1; // max shift in cm w.r.t. RS
- Double_t sigmarot = 0.5; // max rot in degrees w.r.t. RS
+ Double_t sigmatr = 0.1; // max shift in cm
+ Double_t sigmarot = 0.5; // max rot in degrees
// null shifts and rotations
- const char *V0right="/ALIC_1/VZERO_1/V0RI_1";
- const char *V0left="/ALIC_1/VZERO_1/V0LE_1";
+ const char *V0right="VZERO/V0C";
+ const char *V0left="VZERO/V0A";
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
Double_t sigmatr = 0.1; // max shift in cm
Double_t sigmarot = 0.5; // max rot in degrees
- const char *V0right="/ALIC_1/VZERO_1/V0RI_1";
- const char *V0left="/ALIC_1/VZERO_1/V0LE_1";
+ const char *V0right="VZERO/V0C";
+ const char *V0left="VZERO/V0A";
Int_t iIndex=0;
AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
--- /dev/null
+void MakeVZEROZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for VZERO
+ //
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray &alobj = *array;
+
+ AliAlignObjAngles a;
+
+ Double_t dx, dy, dz, dpsi, dtheta, dphi;
+
+ Int_t iIndex=0;
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+ TString V0right("VZERO/V0C");
+ new(alobj[0]) AliAlignObjAngles(V0right.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ TString V0left("VZERO/V0A");
+ new(alobj[1]) AliAlignObjAngles(V0left.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save on file
+ TFile f("V0zeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"V0ZeroAlObjs ","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Brigitte Cheynis");
+ md->SetComment("Alignment objects for V0 zero-misalignment");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("VZERO/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
--- /dev/null
+void MakeZDCZeroMisAlignment(){
+ // Create TClonesArray of zero misalignment objects for ZDC
+ //
+ if(!gGeoManager) TGeoManager::Import("geometry.root");
+ // needed for the constructors with local coordinates not to fail
+
+ TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+ TClonesArray &alobj = *array;
+
+ AliAlignObjAngles a;
+
+ Double_t dx=0., dy=0., dz=0.;
+ Double_t dpsi=0., dtheta=0., dphi=0.;
+
+ const char *ZDCn="ZDC/NeutronZDC";
+ const char *ZDCp="ZDC/ProtonZDC";
+
+ UShort_t iIndex=0;
+ AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+ UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+ new(alobj[0]) AliAlignObjAngles(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[1]) AliAlignObjAngles(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+
+ if(!gSystem->Getenv("$TOCDB")){
+ // save in file
+ TFile f("ZDCzeroMisalignment.root","RECREATE");
+ if(!f) cerr<<"cannot open file for output\n";
+ f.cd();
+ f.WriteObject(array,"ZDCZeroAlObjs ","kSingleKey");
+ f.Close();
+ }else{
+ // save in CDB storage
+ const char* Storage = gSystem->Getenv("$STORAGE");
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* storage = cdb->GetStorage(Storage);
+ AliCDBMetaData* md = new AliCDBMetaData();
+ md->SetResponsible("Chiara Oppedisano");
+ md->SetComment("Alignment objects for ZDC zero misalignment");
+ md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+ AliCDBId id("ZDC/Align/Data",0,9999999);
+ storage->Put(array,id,md);
+ }
+
+ array->Delete();
+
+}
+
TGeoManager::Import("geometry.root");
}
- TString dets="EMCAL,FMD,ITS,MUON,PHOS,PMD,HMPID,T0,TOF,TPC,TRD,VZERO,ZDC";
+ TString dets="EMCAL,FMD,HMPID,ITS,MUON,PHOS,PMD,T0,TOF,TPC,TRD,VZERO,ZDC";
TObjArray *detArray = dets.Tokenize(',');
TIter iter(detArray);
TObjString *ostr;
--- /dev/null
+void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/Zero"){
+ // 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
+ // the objects saved locally on file
+ //
+ TString strStorage(CDBstorage);
+ if(strStorage.IsNull()){
+ gSystem->Setenv("$TOCDB","kFALSE");
+ }else{
+ gSystem->Setenv("$TOCDB","kTRUE");
+ gSystem->Setenv("$STORAGE",strStorage.Data());
+ gSystem->Setenv("$ARVERSION","v4-04-Release");
+ }
+
+ // if not already present, create geometry file needed by those detectors
+ // producing their objects in the local RS
+ if(gSystem->AccessPathName("./geometry.root")){
+ gAlice->Init();
+ gGeoManager->Export("geometry.root");
+ }else{
+ TGeoManager::Import("geometry.root");
+ }
+
+ TString dets="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
+ TObjArray *detArray = dets.Tokenize(',');
+ TIter iter(detArray);
+ TObjString *ostr;
+ TString exec_det_macro;
+
+ while((ostr = (TObjString*) iter.Next())){
+ TString str(ostr->String());
+ exec_det_macro="aliroot -b -q $ALICE_ROOT/";
+ exec_det_macro+=str;
+ exec_det_macro+="/Make";
+ exec_det_macro+=str;
+ exec_det_macro+="ZeroMisAlignment.C";
+
+ gSystem->Exec(exec_det_macro.Data());
+ }
+
+ return;
+}