Added RuleChecker jars in trunk and updated CMake .pkg files
[u/mrichter/AliRoot.git] / ZDC / AliZDCMisAligner.cxx
CommitLineData
e00d46ab 1/**************************************************************************
2 * Copyright(c) 2007-2010, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16//========================================================================
17//
18// This class generates misalignment for ZDC. In particular it defines
19// the misalignment in the three canonical scenarios: "ideal", "residual"
20// and "full".
21// It is meant to be run standalone or from the steering macro
22// $ALICE_ROOT/macros/MakeAlignmentObjs.C
23// looping on the detectors.
24//
25//========================================================================
26
22a44c4a 27#include "AliZDCMisAligner.h"
28#include "AliGeomManager.h"
29#include "TClonesArray.h"
30#include "AliAlignObjParams.h"
31#include "AliLog.h"
32
33ClassImp(AliZDCMisAligner)
34
e00d46ab 35 //_______________________________________________________________________________________
22a44c4a 36AliZDCMisAligner::AliZDCMisAligner() : AliMisAligner()
37{
e00d46ab 38 //
39 // dummy constructor
40 //
22a44c4a 41}
42
43//_______________________________________________________________________________________
dc8f2f93 44TClonesArray* AliZDCMisAligner::MakeAlObjsArray() {
e00d46ab 45 // builds and returns the array of alignment objects
46 // according to the spcified misalignment scenario
47 // ("ideal", "residual" or "full").
48 //
49 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
50 TClonesArray &alobj = *array;
22a44c4a 51
e00d46ab 52 Double_t dx,dy,dz,dpsi,dtheta,dphi;
53 if(TString(GetMisalType())=="ideal")
54 {
55 dx=0., dy=0., dz=0.;
56 dpsi=0., dtheta=0., dphi=0.;
57 }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full")
58 {
59 dx=0., dy=0.05, dz=0.;
60 dpsi=0., dtheta=0., dphi=0.;
61 }else{
62 AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType()));
63 return 0;
64 }
22a44c4a 65
e00d46ab 66 const char *zdcCn="ZDC/NeutronZDC_C";
67 const char *zdcCp="ZDC/ProtonZDC_C";
68 const char *zdcAn="ZDC/NeutronZDC_A";
69 const char *zdcAp="ZDC/ProtonZDC_A";
22a44c4a 70
e00d46ab 71 UShort_t iIndex=0;
72 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
73 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
22a44c4a 74
e00d46ab 75 new(alobj[0]) AliAlignObjParams(zdcCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
76 new(alobj[1]) AliAlignObjParams(zdcCp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
77 new(alobj[2]) AliAlignObjParams(zdcAn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
78 new(alobj[3]) AliAlignObjParams(zdcAp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
22a44c4a 79
e00d46ab 80 return array;
22a44c4a 81}
82
83//_______________________________________________________________________________________
84AliCDBMetaData* AliZDCMisAligner::GetCDBMetaData() const {
e00d46ab 85 // Returns the comment and responsible for the
86 // AliCDBMetaData to be associated with the OCDB entry
87 // containing the ZDC array of misalignment objects
88 //
89 AliCDBMetaData* md = new AliCDBMetaData();
90 md->SetResponsible("Chiara Oppedisano");
91
92 if(TString(GetMisalType())=="ideal")
93 md->SetComment("Alignment objects for ZDC ideal misalignment");
94 if(TString(GetMisalType())=="residual")
95 md->SetComment("Alignment objects for ZDC residual misalignment");
96 if(TString(GetMisalType())=="full")
97 md->SetComment("Alignment objects for ZDC full misalignment");
22a44c4a 98
e00d46ab 99 return md;
22a44c4a 100}