]>
Commit | Line | Data |
---|---|---|
9da38526 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, 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 | /* $Id: */ | |
17 | ||
e54bf126 | 18 | /// \ingroup macros |
19 | /// \file MUONGenerateTestGMS.C | |
20 | /// \brief Macro to generate ad hoc GMS alignment matrices in the agreed format | |
21 | /// | |
22 | /// TClonesArray is saved in the Root file with a key "GMSarray" | |
23 | /// containing TGeoHMatrix objects with TObject::fUniqueID equal to the geometry | |
24 | /// module Ids | |
25 | /// | |
26 | /// \author I. Hrivnacova, IPN Orsay | |
9da38526 | 27 | |
28 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
3bc97234 | 29 | |
9da38526 | 30 | #include "AliMpConstants.h" |
3bc97234 | 31 | |
32 | #include <TFile.h> | |
33 | #include <TGeoMatrix.h> | |
34 | #include <TClonesArray.h> | |
35 | ||
9da38526 | 36 | #endif |
37 | ||
3bc97234 | 38 | void MUONGenerateTestGMS(Bool_t print = kFALSE) |
9da38526 | 39 | { |
e54bf126 | 40 | /// \param print option to switch on printing the processed matrices |
41 | ||
9da38526 | 42 | TFile f("data/GMS.root", "RECREATE"); |
43 | TClonesArray* array = new TClonesArray("TGeoHMatrix",100); | |
44 | ||
45 | for (Int_t i=0; i<AliMpConstants::NofGeomModules(); i++) { | |
46 | TGeoHMatrix* m = new((*array)[i]) TGeoHMatrix(); | |
47 | m->SetUniqueID(i); | |
48 | /// rotate by small angle | |
49 | m->RotateX(i*0.01); | |
bab3c3a6 | 50 | |
51 | if (print) m->Print(); | |
9da38526 | 52 | } |
53 | ||
acea6e15 | 54 | f.WriteObject(array,"GMSarray"); |
9da38526 | 55 | f.Close(); |
56 | } |