void AliPMDAlObjRnd(Float_t max_trans=1.0, Float_t max_rot=0.1) { // 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 */ 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"; //Sectors 1 and 4 Double_t dx14, dy14, dz14; // Misalignment in X,Y and Z Double_t dpsi14, dtheta14, dphi14; // Angular displacements //Sectors 2 and 3 Double_t dx23, dy23, dz23; // Misalignment in X,Y and Z Double_t dpsi23, dtheta23, dphi23; // Angular displacements // At present give some random shifts // generated by random numbers // max_trans : Maximun shifts in X,Y,Z in centimeters // max_rot : Maximum shifts in angles in degrees // Double_t max_trans, max_rot; TRandom *rnd = new TRandom(4357); // For sectors 1 and 4 // Translation displacement dx14 = (rnd->Uniform()-0.5)*max_trans; dy14 = (rnd->Uniform()-0.5)*max_trans; dz14 = (rnd->Uniform()-0.5)*max_trans; //Rotation angles dpsi14 = (rnd->Uniform()-0.5)*max_rot; dtheta14 = (rnd->Uniform()-0.5)*max_rot; dphi14 = (rnd->Uniform()-0.5)*max_rot; // For sectors 2 and 3 // Translation displacement dx23 = (rnd->Uniform()-0.5)*max_trans; dy23 = (rnd->Uniform()-0.5)*max_trans; dz23 = (rnd->Uniform()-0.5)*max_trans; //Rotation angles dpsi23 = (rnd->Uniform()-0.5)*max_rot; dtheta23 = (rnd->Uniform()-0.5)*max_rot; dphi23 = (rnd->Uniform()-0.5)*max_rot; //Create a TClonesArray of Align Object to store displacement Angles TClonesArray *array = new TClonesArray("AliAlignObjParams",10000); TClonesArray &alobj = *array; // Create a File to store the alignment data // the translations and rotations TFile f("PMD_rnd_alobj.root","RECREATE"); if(!f) {cerr<<"cannot open file for output\n";} AliAlignObjParams o; UShort_t iIndex=0; // AliGeomManager::ELayerID iLayer = AliGeomManager::kTOF; // UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy volume identity new(alobj[0]) AliAlignObjParams(Sector1, iIndex, dx14, dy14, dz14, dpsi14, dtheta14, dphi14); new(alobj[1]) AliAlignObjParams(Sector2, iIndex, dx14, dy14, dz14, dpsi14, dtheta14, dphi14); new(alobj[2]) AliAlignObjParams(Sector3, iIndex, dx23, dy23, dz23, dpsi23, dtheta23, dphi23); new(alobj[3]) AliAlignObjParams(Sector4, iIndex, dx23, dy23, dz23, dpsi23, dtheta23, dphi23); // This part needs to be understood f.cd(); f.WriteObject(array,"PMDAlignObjs","kSingleKey"); f.Close(); array->Delete(); }