]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MakeMUONZeroMisAlignment.C
Adding handling of Capacitances (Laurent)
[u/mrichter/AliRoot.git] / MUON / MakeMUONZeroMisAlignment.C
CommitLineData
c2d1365a 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 **************************************************************************/
d3a9c52a 15
c2d1365a 16// $Id$
d3a9c52a 17
c2d1365a 18// Macro for generating the zero misalignment data.
19//
20// Author: I. Hrivnacova, IPN Orsay
d3a9c52a 21
c2d1365a 22void MakeMUONZeroMisAlignment()
23{
24 // Check first if geometry is loaded,
25 // if not loaded try to load it from galice.root file
26 if ( ! gGeoManager && ! TGeoManager::Import("geometry.root") ) {
27 cerr << "Loading geometry failed." << endl;
28 return;
d3a9c52a 29 }
30
c2d1365a 31 AliMUONGeometryTransformer transformer(true);
32 transformer.ReadGeometryData("volpath.dat", gGeoManager);
33 TClonesArray* array = transformer.CreateZeroAlignmentData();;
d3a9c52a 34
c2d1365a 35 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
36 // save in file
37 cout << "Generating zero misalignment data in a file ..." << endl;
d3a9c52a 38
c2d1365a 39 // Create a file to store the alignment data
40 TFile f("MUONzeroMisalignment.root", "RECREATE");
41 if(!f) {
42 cerr<<"cannot open file for output\n";
43 }
d3a9c52a 44 f.cd();
45 f.WriteObject(array,"MUONAlignObjs ","kSingleKey");
46 f.Close();
c2d1365a 47 }
48 else {
49 cout << "Generating zero misalignment data in CDB ..." << endl;
50
d3a9c52a 51 // save in CDB storage
5bd470e1 52 const char* Storage = gSystem->Getenv("STORAGE");
d3a9c52a 53 AliCDBManager* cdbManager = AliCDBManager::Instance();
54 AliCDBStorage* storage = cdbManager->GetStorage(Storage);
55 AliCDBMetaData* cdbData = new AliCDBMetaData();
56 cdbData->SetResponsible("Dimuon Offline project");
5bd470e1 57 cdbData->SetComment("MUON alignment objects with zero misalignment");
58 cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
d3a9c52a 59 AliCDBId id("MUON/Align/Data", 0, 9999999);
60 storage->Put(array, id, cdbData);
61 }
d3a9c52a 62}
63