1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
6 * Indranil Das <indra.das@saha.ac.in> *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 /*********************************************
18 Purpose: A macro to generate buspatch to ddl mapping file
24 Modified: 24/08/2007 (To adopt to AliRoot v4-06-Release)
26 Author: Indranil Das, HEP, SINP, Kolkata
27 Email: indra.das@saha.ac.in
28 ***********************************************/
34 #include <AliCDBManager.h>
37 #include <AliMpDDLStore.h>
38 #include <AliMpDetElement.h>
40 int CreateBusToDetElemFile(TString CDBPath = "local://$ALICE_ROOT", Int_t run = 0)
42 FILE *fp = fopen("BusToDetElem.dat","w");
44 AliMpDetElement* fDetElement;
46 AliCDBManager* cdbManager = AliCDBManager::Instance();
47 cdbManager->SetDefaultStorage(CDBPath.Data());
48 cdbManager->SetRun(run);
50 if (! AliMpCDB::LoadDDLStore(true)){
51 cerr<<__FILE__<<": Failed to Load DDLStore specified for CDBPath "<<CDBPath<<", and Run : "<<run<<endl;
55 fprintf(fp,"#DE\tBusPatch\tDDL\n");
56 for(int ch=7;ch<=10;ch++){
57 fprintf(fp,"# Chamber %d\n",ch);
58 for(int i=0; i<26 ; i++){
59 fDetElement = AliMpDDLStore::Instance()->GetDetElement(ch*100 + i);
60 fprintf(fp,"%d\t%d - %d\t%d\n",ch*100 + i,fDetElement->GetBusPatchId(0),
61 fDetElement->GetBusPatchId(fDetElement->GetNofBusPatches()-1),fDetElement->GetDdlId());