From: coppedis Date: Wed, 8 Apr 2009 13:46:19 +0000 (+0000) Subject: Coding convention compliant version (by Raffaele) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;ds=sidebyside;h=e00d46abaf0beb409c305f9acabdada0c91c3520;p=u%2Fmrichter%2FAliRoot.git Coding convention compliant version (by Raffaele) --- diff --git a/ZDC/AliZDCMisAligner.cxx b/ZDC/AliZDCMisAligner.cxx index 921a4fb1b9d..c097c7ad03c 100644 --- a/ZDC/AliZDCMisAligner.cxx +++ b/ZDC/AliZDCMisAligner.cxx @@ -1,3 +1,29 @@ +/************************************************************************** + * Copyright(c) 2007-2010, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +//======================================================================== +// +// This class generates misalignment for ZDC. In particular it defines +// the misalignment in the three canonical scenarios: "ideal", "residual" +// and "full". +// It is meant to be run standalone or from the steering macro +// $ALICE_ROOT/macros/MakeAlignmentObjs.C +// looping on the detectors. +// +//======================================================================== + #include "AliZDCMisAligner.h" #include "AliGeomManager.h" #include "TClonesArray.h" @@ -6,60 +32,69 @@ ClassImp(AliZDCMisAligner) -//_______________________________________________________________________________________ + //_______________________________________________________________________________________ AliZDCMisAligner::AliZDCMisAligner() : AliMisAligner() { - Printf("asdfasdfasdfasdf\n\n"); - + // + // dummy constructor + // } //_______________________________________________________________________________________ TClonesArray* AliZDCMisAligner::MakeAlObjsArray() { + // builds and returns the array of alignment objects + // according to the spcified misalignment scenario + // ("ideal", "residual" or "full"). + // + TClonesArray *array = new TClonesArray("AliAlignObjParams",10); + TClonesArray &alobj = *array; - TClonesArray *array = new TClonesArray("AliAlignObjParams",10); - TClonesArray &alobj = *array; - - Double_t dx,dy,dz,dpsi,dtheta,dphi; - if(TString(GetMisalType())=="ideal") - { - dx=0., dy=0., dz=0.; - dpsi=0., dtheta=0., dphi=0.; - }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full") - { - dx=0., dy=0.05, dz=0.; - dpsi=0., dtheta=0., dphi=0.; - }else{ - AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType())); - return 0; - } + Double_t dx,dy,dz,dpsi,dtheta,dphi; + if(TString(GetMisalType())=="ideal") + { + dx=0., dy=0., dz=0.; + dpsi=0., dtheta=0., dphi=0.; + }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full") + { + dx=0., dy=0.05, dz=0.; + dpsi=0., dtheta=0., dphi=0.; + }else{ + AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType())); + return 0; + } - const char *ZDCCn="ZDC/NeutronZDC_C"; - const char *ZDCCp="ZDC/ProtonZDC_C"; - const char *ZDCAn="ZDC/NeutronZDC_A"; - const char *ZDCAp="ZDC/ProtonZDC_A"; + const char *zdcCn="ZDC/NeutronZDC_C"; + const char *zdcCp="ZDC/ProtonZDC_C"; + const char *zdcAn="ZDC/NeutronZDC_A"; + const char *zdcAp="ZDC/ProtonZDC_A"; - UShort_t iIndex=0; - AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; - UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex); + UShort_t iIndex=0; + AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; + UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex); - new(alobj[0]) AliAlignObjParams(ZDCCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); - new(alobj[1]) AliAlignObjParams(ZDCCp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); - new(alobj[2]) AliAlignObjParams(ZDCAn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); - new(alobj[3]) AliAlignObjParams(ZDCAp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); + new(alobj[0]) AliAlignObjParams(zdcCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); + new(alobj[1]) AliAlignObjParams(zdcCp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); + new(alobj[2]) AliAlignObjParams(zdcAn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); + new(alobj[3]) AliAlignObjParams(zdcAp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); - return array; + return array; } //_______________________________________________________________________________________ AliCDBMetaData* AliZDCMisAligner::GetCDBMetaData() const { - AliCDBMetaData* md = new AliCDBMetaData(); - md->SetResponsible("Chiara Oppedisano"); + // Returns the comment and responsible for the + // AliCDBMetaData to be associated with the OCDB entry + // containing the ZDC array of misalignment objects + // + AliCDBMetaData* md = new AliCDBMetaData(); + md->SetResponsible("Chiara Oppedisano"); + + if(TString(GetMisalType())=="ideal") + md->SetComment("Alignment objects for ZDC ideal misalignment"); + if(TString(GetMisalType())=="residual") + md->SetComment("Alignment objects for ZDC residual misalignment"); + if(TString(GetMisalType())=="full") + md->SetComment("Alignment objects for ZDC full misalignment"); - if(TString(GetMisalType())=="ideal") - md->SetComment("Alignment objects for ZDC ideal misalignment"); - if(TString(GetMisalType())=="residual") - md->SetComment("Alignment objects for ZDC residual misalignment"); - if(TString(GetMisalType())=="full") - md->SetComment("Alignment objects for ZDC full misalignment"); - return md; + return md; } diff --git a/ZDC/AliZDCMisAligner.h b/ZDC/AliZDCMisAligner.h index 9a71f9bdbe8..682aa984c8d 100644 --- a/ZDC/AliZDCMisAligner.h +++ b/ZDC/AliZDCMisAligner.h @@ -1,27 +1,30 @@ -#ifndef ALI_ZDC_MISALIGNER_H -#define ALI_ZDC_MISALIGNER_H +#ifndef ALIZDCMISALIGNER_H +#define ALIZDCMISALIGNER_H -#include "TNamed.h" -#include "TString.h" #include "AliMisAligner.h" -#include "AliCDBMetaData.h" +// Class building the alignment objects for ZDC in the three +// canonical scenarios "ideal", "residual" and "full". +// It derives from AliMisAligner, thus providing the methods +// MakeAlObjsArray (builds and returns the array of alignment objects) +// and GetCDBMetaData (returns the metadata for the OCDB entry) +// + +class TString; +class TNamed; class TClonesArray; class AliCDBManager; - - // Create a TClonesArray of misalignment objects for ZDC - // of ideal/residual/full type according to request by - // the steering macro +class AliCDBMetaData; class AliZDCMisAligner : public AliMisAligner { - public: - AliZDCMisAligner(); - TClonesArray* MakeAlObjsArray(); - AliCDBMetaData* GetCDBMetaData() const; + public: + AliZDCMisAligner(); + TClonesArray* MakeAlObjsArray(); + AliCDBMetaData* GetCDBMetaData() const; - private: - ClassDef(AliZDCMisAligner,0); + private: + ClassDef(AliZDCMisAligner,0); }; #endif