Separating run-dependent mapping data from data, which are not
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jul 2008 14:05:03 +0000 (14:05 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jul 2008 14:05:03 +0000 (14:05 +0000)
supposed to change with run numbers:
- Introduced new class AliMpManuStore to hold manu serial
  numbers (run-dependent data)
- Moving all manu_serial data in a new data directory: mapping/data_run
- Removing singleton pattern from AliMpDataStreams, as
  we can have now two instances, one per each data directory
(Ivana)

195 files changed:
MUON/AliMUONCDB.cxx
MUON/AliMUONDigitCalibrator.cxx
MUON/AliMUONTrackerData.cxx
MUON/Calib/MappingData/Run0_999999999_v0_s0.root
MUON/Calib/MappingRunData/Run0_999999999_v0_s0.root [new file with mode: 0644]
MUON/MUONmappingLinkDef.h
MUON/READMEmapping.txt
MUON/libMUONmapping.pkg
MUON/mapping/AliMpCDB.cxx
MUON/mapping/AliMpCDB.h
MUON/mapping/AliMpDDLStore.cxx
MUON/mapping/AliMpDDLStore.h
MUON/mapping/AliMpDEStore.cxx
MUON/mapping/AliMpDEStore.h
MUON/mapping/AliMpDEVisu.cxx
MUON/mapping/AliMpDEVisu.h
MUON/mapping/AliMpDataProcessor.cxx
MUON/mapping/AliMpDataStreams.cxx
MUON/mapping/AliMpDataStreams.h
MUON/mapping/AliMpDetElement.cxx
MUON/mapping/AliMpDetElement.h
MUON/mapping/AliMpFiles.cxx
MUON/mapping/AliMpFiles.h
MUON/mapping/AliMpManuStore.cxx [new file with mode: 0644]
MUON/mapping/AliMpManuStore.h [new file with mode: 0644]
MUON/mapping/AliMpMotifReader.cxx
MUON/mapping/AliMpMotifReader.h
MUON/mapping/AliMpRegionalTrigger.cxx
MUON/mapping/AliMpRegionalTrigger.h
MUON/mapping/AliMpSectorReader.cxx
MUON/mapping/AliMpSectorReader.h
MUON/mapping/AliMpSegmentation.cxx
MUON/mapping/AliMpSegmentation.h
MUON/mapping/AliMpSt345Reader.cxx
MUON/mapping/AliMpSt345Reader.h
MUON/mapping/AliMpTriggerReader.cxx
MUON/mapping/AliMpTriggerReader.h
MUON/mapping/data_run/station1/st1_quadrant1_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant1_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant2_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant2_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant3_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant3_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant4_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant4_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant5_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant5_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant6_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant6_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant7_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant7_manu.dat with 100% similarity]
MUON/mapping/data_run/station1/st1_quadrant8_manu.dat [moved from MUON/mapping/data/station1/manu_serial/st1_quadrant8_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant1_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant1_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant2_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant2_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant3_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant3_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant4_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant4_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant5_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant5_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant6_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant6_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant7_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant7_manu.dat with 100% similarity]
MUON/mapping/data_run/station2/st2_quadrant8_manu.dat [moved from MUON/mapping/data/station2/manu_serial/st2_quadrant8_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200NR2_SAC_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200NR2_SAC_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200NR2_SAC_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200NR2_SAC_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200NR2_SAC_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200NR2_SAC_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200NR2_SAC_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200NR2_SAC_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200SR2_NAN_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200SR2_NAN_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200SR2_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200SR2_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200SR2_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200SR2_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200SR2_NAN_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200SR2_NAN_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112200SR2_NAN_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112200SR2_NAN_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112230N_NAN_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112230N_NAN_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_NAN_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_NAN_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233NR3_SAC_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233NR3_SAC_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/112233N_GAT_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/112233N_GAT_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122000NR1_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122000NR1_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122000NR1_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122000NR1_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122000SR1_NAN_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122000SR1_NAN_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122000SR1_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122000SR1_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200N_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200N_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200N_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200N_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200N_SAC_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200N_SAC_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200N_SAC_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200N_SAC_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200S_NAN_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200S_NAN_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200S_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200S_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200S_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200S_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122200S_NAN_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122200S_NAN_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/122330N_CAG_10_manu.dat [moved from MUON/mapping/data/station345/manu_serial/122330N_CAG_10_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/220000N_GAT_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/220000N_GAT_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222000N_CAG_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222000N_CAG_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222330N_SAC_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222330N_SAC_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/222333N_CAG_10_manu.dat [moved from MUON/mapping/data/station345/manu_serial/222333N_CAG_10_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_NAN_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_NAN_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_NAN_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_NAN_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_NAN_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_NAN_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_NAN_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_NAN_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_SAC_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_SAC_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_SAC_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_SAC_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_SAC_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_SAC_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223300N_SAC_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223300N_SAC_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/223330N_SAC_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/223330N_SAC_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_05_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/330000N_CAG_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/330000N_CAG_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_06_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_06_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_07_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_07_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_08_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_08_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_09_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_09_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_10_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_10_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_11_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_11_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_12_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_12_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_13_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_13_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_14_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_14_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_15_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_15_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_16_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_16_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_17_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_17_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333000N_GAT_18_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333000N_GAT_18_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_CAG_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_CAG_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_CAG_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_CAG_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_CAG_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_CAG_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_GAT_01_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_GAT_01_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_GAT_02_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_GAT_02_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_GAT_03_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_GAT_03_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_GAT_04_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_GAT_04_manu.dat with 100% similarity]
MUON/mapping/data_run/station345/333300N_GAT_05_manu.dat [moved from MUON/mapping/data/station345/manu_serial/333300N_GAT_05_manu.dat with 100% similarity]

index 51582cd..f28467e 100644 (file)
@@ -49,6 +49,7 @@
 #include "AliMpCDB.h"
 #include "AliMpConstants.h"
 #include "AliMpDDLStore.h"
+#include "AliMpManuStore.h"
 #include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
 #include "AliMpFiles.h"
@@ -171,6 +172,10 @@ AliMUONCDB::AliMUONCDB(const char* cdbpath)
     if ( ! AliMpCDB::LoadDDLStore() ) {
       AliFatal("Could not access mapping from OCDB !");
     }
+
+    if ( ! AliMpCDB::LoadManuStore() ) {
+      AliFatal("Could not access run-dependent mapping from OCDB !");
+    }
 }
 
 //_____________________________________________________________________________
@@ -488,7 +493,7 @@ AliMUONCDB::MakeCapacitanceStore(AliMUONVStore& capaStore, Bool_t defaultValues)
     ++nmanus;
     
     AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId); 
-    Int_t serialNumber = de->GetManuSerialFromId(manuId);
+    Int_t serialNumber = AliMpManuStore::Instance()->GetManuSerial(detElemId, manuId);
       
     if ( serialNumber <= 0 ) continue;
     
index 65a46c6..aecf707 100644 (file)
 #include "AliMUONVStore.h"
 #include "AliMpBusPatch.h"
 #include "AliMpConstants.h"
+#include "AliMpCDB.h"
 #include "AliMpDDLStore.h"
 #include "AliMpDEIterator.h"
 #include "AliMpDetElement.h"
+#include "AliMpManuStore.h"
 
 //-----------------------------------------------------------------------------
 /// \class AliMUONDigitCalibrator
@@ -63,7 +65,7 @@ const Int_t AliMUONDigitCalibrator::fgkGain(2);
 
 //_____________________________________________________________________________
 AliMUONDigitCalibrator::AliMUONDigitCalibrator(const AliMUONCalibrationData& calib,
-                                                                                                                                                                                        const AliMUONRecoParam* recoParams,
+                                               const AliMUONRecoParam* recoParams,
                                                const char* calibMode)
 : TObject(),
 fLogger(new AliMUONLogger(20000)),
@@ -134,6 +136,11 @@ AliMUONDigitCalibrator::Ctor(const char* calibMode,
     fApplyGains = fgkNoGain;
   }
        
+  // Load mapping manu store
+  if ( ! AliMpCDB::LoadManuStore() ) {
+    AliFatal("Could not access manu store from OCDB !");
+  }
+
   fStatusMaker = new AliMUONPadStatusMaker(calib);
   
   // Set default values, as loose as reasonable
@@ -304,9 +311,10 @@ AliMUONDigitCalibrator::CalibrateDigit(Int_t detElemId, Int_t manuId, Int_t manu
   }
   else if ( fApplyGains == fgkGain ) 
   {
-    AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
     
-    Int_t serialNumber = de->GetManuSerialFromId(manuId);
+
+    Int_t serialNumber 
+      = AliMpManuStore::Instance()->GetManuSerial(detElemId, manuId);
     
     AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(fCapacitances->FindObject(serialNumber));
     
index f58b803..2881362 100644 (file)
@@ -28,7 +28,9 @@
 #include "AliMUONVStore.h"
 #include "AliMpBusPatch.h"
 #include "AliMpConstants.h"
+#include "AliMpCDB.h"
 #include "AliMpDDLStore.h"
+#include "AliMpManuStore.h"
 #include "AliMpDEIterator.h"
 #include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
@@ -1065,11 +1067,17 @@ AliMUONTrackerData::GetDEManu(const AliMUONVCalibParam& param,
 {
   /// Tries to get (detElemId,manuId) of param
   
+  // Load mapping manu store
+  if ( ! AliMpCDB::LoadManuStore() ) {
+    AliError("Could not access manu store from OCDB !");
+    return;
+  }
+
   if ( param.ID1() <= 0 ) 
   {
     // we (probably) get a manu serial number
     Int_t serial = param.ID0();
-    AliMpIntPair pair = AliMpDDLStore::Instance()->GetDetElemIdManu(serial);
+    AliMpIntPair pair = AliMpManuStore::Instance()->GetDetElemIdManu(serial);
     detElemId = pair.GetFirst();
     manuId = pair.GetSecond();
     if ( !detElemId ) 
index 519bffd..f48e441 100644 (file)
Binary files a/MUON/Calib/MappingData/Run0_999999999_v0_s0.root and b/MUON/Calib/MappingData/Run0_999999999_v0_s0.root differ
diff --git a/MUON/Calib/MappingRunData/Run0_999999999_v0_s0.root b/MUON/Calib/MappingRunData/Run0_999999999_v0_s0.root
new file mode 100644 (file)
index 0000000..c0088fc
Binary files /dev/null and b/MUON/Calib/MappingRunData/Run0_999999999_v0_s0.root differ
index 91b6cc2..343a54e 100644 (file)
 #pragma link C++ class  AliMpDDLStore+;
 #pragma link C++ class  AliMpCDB+;
 #pragma link C++ class  AliMpFrtCrocusConstants+;
+#pragma link C++ class  AliMpManuStore+;
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
index 79e86e9..842c0fd 100644 (file)
@@ -17,6 +17,7 @@ The mapping is everywhere in the MUON code loaded from
 OCDB. In case the mapping data files are changed, the mapping
 in OCDB has to be regenerated in this way:
 
+For changes in mapping/data:
 <pre>
 $> cd $ALICE_ROOT/MUON
 $> rm Calib/MappingData/Run0_999999999_v0_s0.root
@@ -24,33 +25,47 @@ $> aliroot
 root [0] AliMpCDB::WriteMpData(); 
 </pre>
 
+For changes in mapping/data_run:
+<pre>
+$> cd $ALICE_ROOT/MUON
+$> rm Calib/MappingRunData/Run0_999999999_v0_s0.root
+$> aliroot
+root [0] AliMpCDB::WriteMpRunData(); 
+</pre>
+
 Note that mapping has to be loaded from OCDB almost each time
 when using MUON classes; the loading of mapping depends on
 the CBD manager state (the current run number, storage ...).
 The standard way of loading mapping expects the CDB manager
 in a state well defined beforehand; this way is used in
 the MUON code:
-
 <pre>
 if ( ! AliMpCDB::LoadDDLStore() ) {
   AliFatal("Could not access mapping from OCDB !");
 }
 </pre>
-
+In the same way, you can load AliMpManuStore, when manu serial 
+numbers are needed:
+<pre>
+if ( ! AliMpCDB::LoadManuStore() ) {
+  AliFatal("Could not access run-dependent mapping from OCDB !");
+}
+</pre>
 In the interactive Root session, in case the CDB manager state is 
 not defined, you can load mapping from the local OCDB files in this 
 way:
 <pre>
 root [0] AliMpCDB::LoadDDLStore2();
+root [2] AliMpCDB::LoadManuStore2();
 </pre>
 
-
 \section mapping_s1  Graphical User Interface
   
 To use the GUI to plot DE segmentation run:
 
 <pre> 
 AliMpCDB::LoadDDLStore2();
+AliMpCDB::LoadManuStore2();
 new AliMpDEVisu();
 </pre>
 
@@ -58,6 +73,7 @@ or
 
 <pre>
 AliMpCDB::LoadDDLStore2();
+AliMpCDB::LoadManuStore2();
 new AliMpDEVisu(w, h);
 </pre>
 
@@ -89,7 +105,10 @@ of the mapping classes. To run these macros:
 </pre>
                    
 
-\section mapping_s3  Data files format
+\section mapping_s3  Data files in mapping/data
+
+The directory data in $ALICE_ROOT/MUON/mapping contains files
+with data which are not supposed to be changed in a long period.
 
 \subsection mapping_s3_sub1  zones.dat
 
@@ -314,7 +333,24 @@ Two files a generated: one with the list of manu per detection element with thei
 value, the other with the bad, strange or unidentified serial number.
 
 
-\section mapping_s4  Units used
+\section mapping_s4  Data files in mapping/data_run
+
+The directory data_run in $ALICE_ROOT/MUON/mapping contains files
+with data which are expected to change during experiment.
+At present time, there are only files with manu serial numbers:
+
+\subsection mapping_s4_sub1  deName_manu_dat.dat
+
+Contains the list of manuIds and their serial numbers.
+
+<pre> 
+# Id bp/nbp serial
+1 bp 4615
+2 bp 4616
+...
+</pre> 
+
+\section mapping_s5  Units used
  
 Lengths are in centimeters.
  
index d12c7e1..74910d7 100644 (file)
@@ -100,7 +100,8 @@ SRCS +=  \
          mapping/AliMpDDL.cxx \
         mapping/AliMpDDLStore.cxx \
         mapping/AliMpCDB.cxx \
-         mapping/AliMpFrtCrocusConstants.cxx
+         mapping/AliMpFrtCrocusConstants.cxx \
+         mapping/AliMpManuStore.cxx
 
 # Category graphics
 #
index a58e87d..9b38997 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "AliMpSegmentation.h"
 #include "AliMpDDLStore.h"
+#include "AliMpManuStore.h"
 #include "AliMpDataProcessor.h"
 #include "AliMpDataStreams.h"
 #include "AliMpDataMap.h"
@@ -136,8 +137,8 @@ Bool_t AliMpCDB::LoadMpSegmentation(Bool_t warn)
     // Pass the map to the streams and then read segmentation
     // from data map
     AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
-    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
-    AliMpSegmentation::ReadData();
+    AliMpDataStreams dataStreams(dataMap);
+    AliMpSegmentation::ReadData(dataStreams);
     return kTRUE;
   }
   else {
@@ -170,8 +171,8 @@ Bool_t AliMpCDB::LoadDDLStore(Bool_t warn)
     if ( ! cdbEntryObject ) return kFALSE;
   
     AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
-    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
-    AliMpDDLStore::ReadData();
+    AliMpDataStreams dataStreams(dataMap);
+    AliMpDDLStore::ReadData(dataStreams);
     return kTRUE;
   }
   else {
@@ -188,6 +189,43 @@ Bool_t AliMpCDB::LoadDDLStore(Bool_t warn)
 }    
 
 //______________________________________________________________________________
+Bool_t AliMpCDB::LoadManuStore(Bool_t warn)
+{
+/// Load the DDL store from the mapping data from OCDB,
+///  if it does not yet exist;
+/// return false only in case loading from CDB failed
+
+  if ( AliMpManuStore::Instance(false) ) {
+    if ( warn )  
+      AliWarningClass("Manu Store has been already loaded."); 
+    return true;
+  }  
+  
+  if ( fgLoadFromData ) {
+    AliDebugClassStream(1)
+      << "Loading Manu store from MUON/Calib/MappingRunData" << endl;
+  
+    // Load segmentation
+    LoadMpSegmentation(warn); 
+
+    TObject* cdbEntryObject = GetCDBEntryObject("MUON/Calib/MappingRunData");
+    if ( ! cdbEntryObject ) return kFALSE;
+  
+    AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+    AliMpDataStreams dataStreams(dataMap);
+    AliMpManuStore::ReadData(dataStreams);
+    return kTRUE;
+  }
+  else {
+    AliDebugClassStream(1)
+      << "Loading Manu store from MUON/Calib/ManuStore" << endl;
+  
+    // Load Manu store
+    TObject* cdbEntryObject =  GetCDBEntryObject("MUON/Calib/ManuStore");
+    return cdbEntryObject != 0x0;
+  }     
+}    
+//______________________________________________________________________________
 Bool_t AliMpCDB::LoadMpSegmentation2(const char* cdbpath, Int_t runNumber, 
                                      Bool_t warn)
 {
@@ -214,8 +252,8 @@ Bool_t AliMpCDB::LoadMpSegmentation2(const char* cdbpath, Int_t runNumber,
     // Pass the map to the streams and then read segmentation
     // from data map
     AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
-    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
-    AliMpSegmentation::ReadData();
+    AliMpDataStreams dataStreams(dataMap);
+    AliMpSegmentation::ReadData(dataStreams);
     return kTRUE;
   }
   else {
@@ -252,8 +290,8 @@ Bool_t AliMpCDB::LoadDDLStore2(const char* cdbpath, Int_t runNumber,
     if ( ! cdbEntryObject ) return kFALSE;
   
     AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
-    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
-    AliMpDDLStore::ReadData();
+    AliMpDataStreams dataStreams(dataMap);
+    AliMpDDLStore::ReadData(dataStreams);
     return kTRUE;
   }
   else {
@@ -270,6 +308,47 @@ Bool_t AliMpCDB::LoadDDLStore2(const char* cdbpath, Int_t runNumber,
 }    
 
 //______________________________________________________________________________
+Bool_t AliMpCDB::LoadManuStore2(const char* cdbpath, Int_t runNumber, 
+                                Bool_t warn)
+{
+/// Load the DDL store from the CDB if it does not yet exist
+/// return false only in case loading from CDB failed
+/// In difference from LoadDDLStore(), in this method the CDB path
+/// and run is set directly via arguments.
+
+  if ( AliMpManuStore::Instance(false) ) {
+    if ( warn )  
+      AliWarningClass("Manu Store has been already loaded."); 
+    return true;
+  }  
+  
+  if ( fgLoadFromData ) {
+    AliDebugClassStream(1)
+      << "Loading Manu store from MUON/Calib/MappingRunData" << endl;
+  
+    // Load segmentation
+    LoadMpSegmentation2(cdbpath, runNumber, warn); 
+
+    TObject* cdbEntryObject 
+      = GetCDBEntryObject("MUON/Calib/MappingRunData", cdbpath, runNumber);
+    if ( ! cdbEntryObject ) return kFALSE;
+  
+    AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+    AliMpDataStreams dataStreams(dataMap);
+    AliMpManuStore::ReadData(dataStreams);
+    return kTRUE;
+  }
+  else {
+    AliDebugClassStream(1)
+      << "Loading Manu store from MUON/Calib/ManuStore" << endl;
+  
+    // Load Manu store
+    TObject* cdbEntryObject =  GetCDBEntryObject("MUON/Calib/ManuStore");
+    return cdbEntryObject != 0x0;
+  }  
+}    
+
+//______________________________________________________________________________
 Bool_t AliMpCDB::WriteMpData()
 {
 /// Write mapping data in OCDB
@@ -285,7 +364,27 @@ Bool_t AliMpCDB::WriteMpData()
   AliCDBId id("MUON/Calib/MappingData", 0, AliCDBRunRange::Infinity()); 
 
   AliMpDataProcessor mp;
-  AliMpDataMap* map = mp.CreateDataMap();
+  AliMpDataMap* map = mp.CreateDataMap("data");
+  return cdbManager->Put(map, id, cdbData);
+}
+
+//______________________________________________________________________________
+Bool_t AliMpCDB::WriteMpRunData()
+{
+/// Write mapping data in OCDB
+
+  AliCDBManager* cdbManager = AliCDBManager::Instance();
+  if ( ! cdbManager->GetDefaultStorage() )
+    cdbManager->SetDefaultStorage("local://$ALICE_ROOT");
+  
+  AliCDBMetaData* cdbData = new AliCDBMetaData();
+  cdbData->SetResponsible("Dimuon Offline project");
+  cdbData->SetComment("MUON run-dependent mapping");
+  cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+  AliCDBId id("MUON/Calib/MappingRunData", 0, AliCDBRunRange::Infinity()); 
+
+  AliMpDataProcessor mp;
+  AliMpDataMap* map = mp.CreateDataMap("data_run");
   return cdbManager->Put(map, id, cdbData);
 }
 
@@ -307,8 +406,9 @@ Bool_t AliMpCDB::WriteMpSegmentation(Bool_t readData)
   AliCDBId id("MUON/Calib/Mapping", 0, AliCDBRunRange::Infinity()); 
 
   if ( readData ) {
-    AliMpSegmentation::ReadData(false);
-    AliMpDDLStore::ReadData(false);
+    AliMpDataStreams dataStreams;
+    AliMpSegmentation::ReadData(dataStreams, false);
+    AliMpDDLStore::ReadData(dataStreams, false);
   }
   
   return cdbManager->Put(AliMpSegmentation::Instance(), id, cdbData);
@@ -332,13 +432,39 @@ Bool_t AliMpCDB::WriteDDLStore(Bool_t readData)
   AliCDBId id("MUON/Calib/DDLStore", 0, AliCDBRunRange::Infinity()); 
 
   if ( readData ) {
-    AliMpSegmentation::ReadData(false);
-    AliMpDDLStore::ReadData(false);
+    AliMpDataStreams dataStreams;
+    AliMpSegmentation::ReadData(dataStreams, false);
+    AliMpDDLStore::ReadData(dataStreams, false);
   }
   return cdbManager->Put(AliMpDDLStore::Instance(), id, cdbData);
 }   
 
 //______________________________________________________________________________
+Bool_t AliMpCDB::WriteManuStore(Bool_t readData)
+{
+/// Write mapping Manu store in OCDB
+
+  if ( ! readData && ! AliMpManuStore::Instance() ) return false;
+
+  AliCDBManager* cdbManager = AliCDBManager::Instance();
+  if ( ! cdbManager->GetDefaultStorage() )
+    cdbManager->SetDefaultStorage("local://$ALICE_ROOT");
+  
+  AliCDBMetaData* cdbData = new AliCDBMetaData();
+  cdbData->SetResponsible("Dimuon Offline project");
+  cdbData->SetComment("MUON Manu store");
+  cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+  AliCDBId id("MUON/Calib/ManuStore", 0, AliCDBRunRange::Infinity()); 
+
+  if ( readData ) {
+    AliMpDataStreams dataStreams;
+    AliMpSegmentation::ReadData(dataStreams, false);
+    AliMpManuStore::ReadData(dataStreams, false);
+  }
+  return cdbManager->Put(AliMpManuStore::Instance(), id, cdbData);
+}   
+
+//______________________________________________________________________________
 Bool_t  AliMpCDB::GenerateMpData(const char* cdbpath, Int_t runNumber)
 {
 /// Generate mapping data ASCII files from OCDB
@@ -352,4 +478,18 @@ Bool_t  AliMpCDB::GenerateMpData(const char* cdbpath, Int_t runNumber)
   return mp.GenerateData(dataMap);
 } 
 
+//______________________________________________________________________________
+Bool_t  AliMpCDB::GenerateMpRunData(const char* cdbpath, Int_t runNumber)
+{
+/// Generate mapping data ASCII files from OCDB
+
+  TObject* cdbEntryObject 
+    = GetCDBEntryObject("MUON/Calib/MappingRunData", cdbpath, runNumber);
+  if ( ! cdbEntryObject ) return kFALSE;
+  
+  AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+  AliMpDataProcessor mp;
+  return mp.GenerateData(dataMap);
+} 
+
 
index f537506..0d02935 100644 (file)
@@ -40,6 +40,7 @@ class AliMpCDB : public  TObject {
 
     static Bool_t LoadMpSegmentation(Bool_t warn = false);
     static Bool_t LoadDDLStore(Bool_t warn = false);
+    static Bool_t LoadManuStore(Bool_t warn = false);
     
     static Bool_t LoadMpSegmentation2(
                     const char* cdbpath = "local://$ALICE_ROOT",
@@ -49,14 +50,23 @@ class AliMpCDB : public  TObject {
                     const char* cdbpath = "local://$ALICE_ROOT",
                     Int_t runNumber = 0,
                     Bool_t warn = false);
+    static Bool_t LoadManuStore2(
+                    const char* cdbpath = "local://$ALICE_ROOT",
+                    Int_t runNumber = 0,
+                    Bool_t warn = false);
 
     static Bool_t WriteMpData();
+    static Bool_t WriteMpRunData();
     static Bool_t WriteMpSegmentation(Bool_t readData = true);
     static Bool_t WriteDDLStore(Bool_t readData= true);
+    static Bool_t WriteManuStore(Bool_t readData= true);
     
     static Bool_t GenerateMpData(
                     const char* cdbpath = "local://$ALICE_ROOT",
                     Int_t runNumber = 0);
+    static Bool_t GenerateMpRunData(
+                    const char* cdbpath = "local://$ALICE_ROOT",
+                    Int_t runNumber = 0);
 
     // Switch loading
     static void SetLoadFromData(Bool_t loadFromData);
@@ -85,7 +95,7 @@ class AliMpCDB : public  TObject {
 
 inline void AliMpCDB::SetLoadFromData(Bool_t loadFromData)
 {
-/// Set option for loading from objects
+/// Set option for loading from CDB mapping data or from CDB mapping objects
 
   fgLoadFromData = loadFromData;
 }  
index 9775e26..6933e64 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliMpDataStreams.h"
 #include "AliMpHelper.h"
 #include "AliMpDEManager.h"
+#include "AliMpManuStore.h"
 #include "AliMpDetElement.h"
 #include "AliMpBusPatch.h"
 #include "AliMpTriggerCrate.h"
@@ -83,7 +84,8 @@ AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
 }
 
 //______________________________________________________________________________
-AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn) 
+AliMpDDLStore* AliMpDDLStore::ReadData(const AliMpDataStreams& dataStreams,
+                                       Bool_t warn) 
 {
     /// Load the DDL store from ASCII data files
     /// and return its instance
@@ -94,10 +96,10 @@ AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn)
         return fgInstance;
     }
 
-    if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
-      AliInfoClass("Reading DDL Store from ASCII files.");
+    if ( dataStreams.GetReadFromFiles() )
+      AliInfoClass("Reading Manu Store from ASCII files.");
 
-    fgInstance = new AliMpDDLStore();
+    fgInstance = new AliMpDDLStore(dataStreams);
     return fgInstance;
 }
 
@@ -106,8 +108,9 @@ AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn)
 //
 
 //______________________________________________________________________________
-AliMpDDLStore::AliMpDDLStore()
+AliMpDDLStore::AliMpDDLStore(const AliMpDataStreams& dataStreams)
         : TObject(),
+        fDataStreams(dataStreams),
         fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
         fBusPatches(),
         fManuList12(),
@@ -123,7 +126,7 @@ AliMpDDLStore::AliMpDDLStore()
     
     // Load segmentation & DE store data
     if ( ! AliMpSegmentation::Instance(false) )
-        AliMpSegmentation::ReadData(true);
+        AliMpSegmentation::ReadData(dataStreams, true);
 
     // Create all detection elements
     ReadDDLs();
@@ -138,6 +141,7 @@ AliMpDDLStore::AliMpDDLStore()
 //______________________________________________________________________________
 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* ioCtor)
         : TObject(),
+        fDataStreams(ioCtor),
         fDDLs(),
         fBusPatches(ioCtor),
         fRegionalTrigger(ioCtor)
@@ -205,8 +209,8 @@ Bool_t AliMpDDLStore::ReadDDLs()
     /// Read ddl <-> bus patch file
 
     istream& in 
-      = AliMpDataStreams::Instance()
-        ->CreateDataStream(AliMpFiles::BusPatchFilePath());
+      = fDataStreams.
+          CreateDataStream(AliMpFiles::BusPatchFilePath());
 
     char line[255];
 
@@ -294,7 +298,7 @@ Bool_t  AliMpDDLStore::ReadTrigger()
 {
     /// create trigger DDL object and Global crate object
   
-  if ( ! fRegionalTrigger.ReadData() ) return false;
+  if ( ! fRegionalTrigger.ReadData(fDataStreams) ) return false;
 
   return true;
 }
@@ -473,8 +477,8 @@ Bool_t AliMpDDLStore::ReadBusPatchSpecial()
 /// and reset the manus arrays filled via SetManu function
 
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::BusPatchSpecialFilePath());
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::BusPatchSpecialFilePath());
 
   char line[255];
 
@@ -580,8 +584,8 @@ Bool_t AliMpDDLStore::ReadBusPatchInfo()
     /// read the buspatch info file and set buspatch info
 
     istream& in 
-      = AliMpDataStreams::Instance()
-        ->CreateDataStream(AliMpFiles::BusPatchInfoFilePath());
+      = fDataStreams.
+          CreateDataStream(AliMpFiles::BusPatchInfoFilePath());
 
     char line[255];
 
@@ -832,18 +836,6 @@ AliMpIntPair  AliMpDDLStore::GetLinkPortId(Int_t busPatchId) const {
 }
 
 //______________________________________________________________________________
-AliMpIntPair  AliMpDDLStore::GetDetElemIdManu(Int_t manuSerial) const {
-    /// Return the detElemId and manuId for given serial manu number
-
-    if ( ! AliMpDEStore::Instance() ) {
-        AliFatal("DE Store has not been loaded.");
-        return AliMpIntPair::Invalid();
-    }
-
-    return AliMpDEStore::Instance()->GetDetElemIdManu(manuSerial);
-}
-
-//______________________________________________________________________________
 void AliMpDDLStore::PrintAllManu() const {
     /// Print all manu Ids and their serial numbers sorted by detection element
     /// and bus patch.                                                            \n
@@ -868,11 +860,15 @@ void AliMpDDLStore::PrintAllManu() const {
             }
             cout << endl;
 
-            cout << "    Manu serial: ";
-            for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
-                cout << std::setw(6) << de->GetManuSerialFromId(busPatch->GetManuId(k)) << " ";
-            }
-            cout << endl;
+            if ( AliMpManuStore::Instance(kFALSE) ) {
+              cout << "    Manu serial: ";
+              for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
+                cout << std::setw(6) 
+                     << AliMpManuStore::Instance()
+                        ->GetManuSerial(de->GetId(), busPatch->GetManuId(k)) << " ";
+              }
+              cout << endl;
+            }  
         }
     }
 }
index 04d9377..ea717eb 100644 (file)
@@ -30,6 +30,7 @@ class AliMpDetElement;
 class AliMpBusPatch;
 class AliMpLocalBoard;
 class AliMpTriggerCrate;
+class AliMpDataStreams;
 class TArrayI;
 
 class AliMpDDLStore : public  TObject {
@@ -40,7 +41,8 @@ class AliMpDDLStore : public  TObject {
     
     // static access method
     static AliMpDDLStore* Instance(Bool_t warn = true); 
-    static AliMpDDLStore* ReadData(Bool_t warn = true);
+    static AliMpDDLStore* ReadData(const AliMpDataStreams& dataStreams,
+                                   Bool_t warn = true);
     
     // methods
     AliMpDDL*          GetDDL(Int_t ddlId, Bool_t warn = true) const;
@@ -62,9 +64,6 @@ class AliMpDDLStore : public  TObject {
     Int_t  GetBusPatchId(Int_t detElemId, Int_t manuId) const;
     
 
-    /// Get detection elt and Manu number from serial number
-    AliMpIntPair  GetDetElemIdManu(Int_t manuSerial) const;
-    
     /// Get link port and DSP from busPatch id
     AliMpIntPair  GetLinkPortId(Int_t busPatchId) const;
 
@@ -77,6 +76,8 @@ class AliMpDDLStore : public  TObject {
     TIterator* CreateBusPatchIterator() const; 
     
   private:
+    AliMpDDLStore(const AliMpDataStreams& dataStreams);
+    /// Not implemented
     AliMpDDLStore();
     /// Not implemented
     AliMpDDLStore(const AliMpDDLStore& rhs);
@@ -103,6 +104,7 @@ class AliMpDDLStore : public  TObject {
     static const TString  fgkExplicitKeyword; ///< A keyword for ReadBusPatchSpecial()
 
     // data members    
+    const AliMpDataStreams&  fDataStreams;  //!< Data streams
     TObjArray     fDDLs;           ///< Array of DDL objects
     AliMpExMap    fBusPatches;     ///< The map of bus patches per their IDs
     TArrayI       fManuList12[16]; ///< Arrays of 1st manu in bus
index b72e521..d782e1a 100644 (file)
@@ -71,7 +71,8 @@ AliMpDEStore* AliMpDEStore::Instance(Bool_t warn)
 }    
 
 //______________________________________________________________________________
-AliMpDEStore* AliMpDEStore::ReadData(Bool_t warn)
+AliMpDEStore* AliMpDEStore::ReadData(const AliMpDataStreams& dataStreams, 
+                                     Bool_t warn)
 {
 /// Load the DE store data from ASCII data files
 /// and return its instance
@@ -82,10 +83,10 @@ AliMpDEStore* AliMpDEStore::ReadData(Bool_t warn)
     return fgInstance;
   }  
   
-  if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
+  if ( dataStreams.GetReadFromFiles() )
     AliInfoClass("Reading DE Store from ASCII files.");
 
-  fgInstance = new AliMpDEStore();
+  fgInstance = new AliMpDEStore(dataStreams);
   return fgInstance;
 }    
 
@@ -94,8 +95,9 @@ AliMpDEStore* AliMpDEStore::ReadData(Bool_t warn)
 //
 
 //______________________________________________________________________________
-AliMpDEStore::AliMpDEStore()
+AliMpDEStore::AliMpDEStore(const AliMpDataStreams& dataStreams)
 : TObject(),
+  fDataStreams(dataStreams),
   fDetElements()
 {  
 /// Standard constructor
@@ -110,6 +112,7 @@ AliMpDEStore::AliMpDEStore()
 //______________________________________________________________________________
 AliMpDEStore::AliMpDEStore(TRootIOCtor* ioCtor)
 : TObject(),
+  fDataStreams(ioCtor),
   fDetElements(ioCtor)
 {  
 /// Constructor for IO
@@ -190,58 +193,6 @@ AliMp::StationType AliMpDEStore::StationType(const TString& stationTypeName)
 }
 
 //______________________________________________________________________________
-Bool_t AliMpDEStore::ReadManuToSerialNbs(AliMpDetElement* detElement, 
-                                         AliMp::StationType stationType)
-{
-/// Read manu serial numbers for the given detection element
-
-  // Nothing to be done for trigger
-  if ( stationType == AliMp::kStationTrigger ) return true;
-
-  static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
-
-  TString deName = detElement->GetDEName();
-
-  istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::ManuToSerialPath(deName, stationType));
-
-  // Change to Error when all files available
-  //if ( !in.is_open() && stationType == AliMp::kStation345 ) {
-  //   AliWarningStream() << "File " << infile << " not found." << endl;
-  //  return false;
-  //}   
-       
-  char line[80];
-
-  while ( in.getline(line,80) ) {
-
-    if ( line[0] == '#' ) continue;
-
-    TString tmp(AliMpHelper::Normalize(line));
-
-    TObjArray* stringList = tmp.Tokenize(TString(" "));
-
-    Int_t manuId     = atoi( ((TObjString*)stringList->At(0))->GetName());
-    Int_t manuSerial = atoi( ((TObjString*)stringList->At(2))->GetName());
-      
-    TString sPlane = ((TObjString*)stringList->At(1))->GetString();
-
-    // filling manuId <> manuSerial
-    if (!sPlane.CompareTo(PlaneTypeName(AliMp::kBendingPlane)))
-       detElement->AddManuSerial(manuId, manuSerial);
-    else 
-       detElement->AddManuSerial(manuId + manuMask, manuSerial);
-
-    delete stringList;
-  }
-   
-  delete &in; 
-   
-  return true;
-}
-
-//______________________________________________________________________________
 Bool_t
 AliMpDEStore::ReadDENames(AliMp::StationType station)
 { 
@@ -250,8 +201,8 @@ AliMpDEStore::ReadDENames(AliMp::StationType station)
 
   // Open stream
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::DENamesFilePath(station));
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::DENamesFilePath(station));
   
   // Read plane types per cathods
   //
@@ -338,9 +289,6 @@ AliMpDEStore::ReadDENames(AliMp::StationType station)
         AliDebugClassStream(3)  
           << "Adding DE name "  << detElemId << "  " << name << endl;
         fDetElements.Add(detElemId, detElement); 
-        
-        // Read manu serial numbers for this det element
-        ReadManuToSerialNbs(detElement, station);
       } 
       else 
       {
@@ -417,21 +365,3 @@ AliMpDetElement* AliMpDEStore::GetDetElement(const TString& deName, Bool_t warn)
   return 0x0;   
 
 }
-//______________________________________________________________________________
-AliMpIntPair  AliMpDEStore::GetDetElemIdManu(Int_t manuSerial) const
-{
-/// Return the detElemId and manuId for given serial manu number
-
-  TIter next(fDetElements.CreateIterator());
-  AliMpDetElement* detElement;
-  
-  while ( ( detElement = static_cast<AliMpDetElement*>(next()) ) )
-  {
-    Int_t manuId = detElement->GetManuIdFromSerial(manuSerial);
-    if ( manuId ) return AliMpIntPair(detElement->GetId(), manuId);
-  }    
-
-  // manu with this serial number does not exist
-  return AliMpIntPair::Invalid();
-}  
-
index 4e802ee..3a5eaaf 100644 (file)
@@ -23,6 +23,7 @@
 #include "AliMpIntPair.h"
 
 class AliMpDetElement;
+class AliMpDataStreams;
 class TString;
 
 class AliMpDEStore : public  TObject {
@@ -35,15 +36,16 @@ class AliMpDEStore : public  TObject {
     
     // static access method
     static AliMpDEStore* Instance(Bool_t warn = true); 
-    static AliMpDEStore* ReadData(Bool_t warn = true);
+    static AliMpDEStore* ReadData(const AliMpDataStreams& dataStreams,
+                                  Bool_t warn = true);
     
     // methods
     AliMpDetElement* GetDetElement(Int_t detElemId, Bool_t warn = true) const;
     AliMpDetElement* GetDetElement(const TString& detName, Bool_t warn = true) const;
-
-    AliMpIntPair     GetDetElemIdManu(Int_t manuSerial) const;
     
   private:
+    AliMpDEStore(const AliMpDataStreams& dataStreams);
+    /// Not implemented
     AliMpDEStore();
     /// Not implemented
     AliMpDEStore(const AliMpDEStore& rhs);
@@ -55,8 +57,6 @@ class AliMpDEStore : public  TObject {
     AliMp::PlaneType   PlaneType(const TString& planeTypeName);
     AliMp::StationType StationType(const TString& stationTypeName);
 
-    Bool_t ReadManuToSerialNbs(AliMpDetElement* detElement, 
-                       AliMp::StationType stationType);
     Bool_t ReadDENames(AliMp::StationType stationType);
     void   FillDEs();
 
@@ -65,7 +65,8 @@ class AliMpDEStore : public  TObject {
     static const char    fgkCommentPrefix; ///< Comment prefix in DE names file
 
     // data members    
-    AliMpExMap fDetElements; ///< Map between DE Ids and DE objects
+    const AliMpDataStreams&  fDataStreams; //!< Data streams
+    AliMpExMap  fDetElements; ///< Map between DE Ids and DE objects
       
   ClassDef(AliMpDEStore,1)  // The manager class for definition of detection element types
 };
index ec8f4ea..2301ecd 100644 (file)
 #include "AliMpSegmentation.h"
 #include "AliMpPad.h"
 #include "AliMpDDLStore.h"
+#include "AliMpManuStore.h"
 #include "AliMpVPadIterator.h"
 #include "AliMpCDB.h"
+#include "AliMpDataStreams.h"
 
 #include "AliLog.h"
 
@@ -92,6 +94,7 @@ AliMpDEVisu::AliMpDEVisu(UInt_t w, UInt_t h)
   fCurrentDEName(),
   fSegmentation(),
   fDDLStore(0x0),
+  fManuStore(0x0),
   fZoomMode(false)
 {
 /// Standard constructor
@@ -101,8 +104,12 @@ AliMpDEVisu::AliMpDEVisu(UInt_t w, UInt_t h)
     AliFatal("Could not access mapping from OCDB !");
   }
 
-  fDDLStore = AliMpDDLStore::Instance();
+  if ( ! AliMpCDB::LoadManuStore() ) {
+    AliFatal("Could not access run-dependent mapping from OCDB !");
+  }
 
+  fDDLStore = AliMpDDLStore::Instance();
+  fManuStore = AliMpManuStore::Instance();
 
   fTrashList.SetOwner(kFALSE);
   
@@ -434,8 +441,10 @@ void AliMpDEVisu::DrawSlat(Option_t* option, Bool_t popup)
   
   AliMpDetElement* detElem = AliMpDEManager::GetDetElement(fCurrentDetElem);
   TString nameType =  detElem->GetSegType();
-  
-  AliMpSt345Reader reader;  
+
+  AliMpDataStreams dataStreams;
+
+  AliMpSt345Reader reader(dataStreams);  
   AliMpSlat* slatCurrent = reader.ReadSlat(nameType.Data(), fCurrentPlane);
   AliMpSlat* slatOther   = reader.ReadSlat(nameType.Data(), AliMp::OtherPlaneType(fCurrentPlane));
   
@@ -467,10 +476,12 @@ void AliMpDEVisu::DrawQuadrant(Option_t* option, Bool_t popup)
   AliMpDetElement* detElem = AliMpDEManager::GetDetElement(fCurrentDetElem);
   AliMp::StationType  station = detElem->GetStationType();
 
-  AliMpSectorReader readerCurrent(station, fCurrentPlane);
+  AliMpDataStreams dataStreams;
+  
+  AliMpSectorReader readerCurrent(dataStreams, station, fCurrentPlane);
   AliMpSector* sectorCurrent = readerCurrent.BuildSector();
     
-  AliMpSectorReader readerOther(station, AliMp::OtherPlaneType(fCurrentPlane));
+  AliMpSectorReader readerOther(dataStreams, station, AliMp::OtherPlaneType(fCurrentPlane));
   AliMpSector* sectorOther = readerOther.BuildSector();
   
   AliMpVPainter *painter = AliMpVPainter::CreatePainter(sectorCurrent);
@@ -583,8 +594,7 @@ void AliMpDEVisu::InfoDE()
   Int_t firstBus     = TMath::MinElement(detElem->GetNofBusPatches(), vec);
   Int_t lastBus      = TMath::MaxElement(detElem->GetNofBusPatches(), vec);
   
-  detElem = AliMpDEManager::GetDetElement(fCurrentDetElem);
-  Int_t numberOfSerialManu = detElem->NofManusWithSerialNumber(); // number of manu with an identified serial number
+  Int_t numberOfSerialManu = fManuStore->NofManus(detElem->GetId()); // number of manu with an identified serial number
   
   fLogMessage->AddLine(Form("DrawDE: detection element: %d, name: %s", 
                       fCurrentDetElem, fCurrentDEName.Data()));
@@ -895,9 +905,9 @@ void AliMpDEVisu::InfoManuMotif(AliMpMotifPosition* motifPos)
                               motifPos->GetMotif()->GetPadDimensions(0).Y()*2. ));
 
     fLogMessage->AddLine( Form("PopupManuMotif: manu: %d, serial number: %d, buspatch: %d",
-                              manuId, 
-                              fDDLStore->GetDetElement(fCurrentDetElem)->GetManuSerialFromId(manuId),
-                              fDDLStore->GetBusPatchId(fCurrentDetElem, manuId)) );
+                             manuId, 
+                             fManuStore->GetManuSerial(fCurrentDetElem, manuId),
+                             fDDLStore->GetBusPatchId(fCurrentDetElem, manuId)) );
 
     fLogMessage->ShowBottom();
 
index 17d21b5..75a4b5c 100644 (file)
@@ -32,6 +32,7 @@ class AliMpSlat;
 class AliMpSector;
 class AliMpVSegmentation;
 class AliMpDDLStore;
+class AliMpManuStore;
 class TGTextEntry;
 class AliMpMotifPosition;
 
@@ -103,6 +104,7 @@ private:
 
     const AliMpVSegmentation* fSegmentation; //!< segmentation instance
     AliMpDDLStore*            fDDLStore;     //!< DDL Store
+    AliMpManuStore*           fManuStore;    //!< Manu Store
 
     Bool_t           fZoomMode;        //!< flag for zoom mode on canvas instead of click mode
 
index 2d5e872..0e5b677 100644 (file)
@@ -115,7 +115,9 @@ void AliMpDataProcessor::ProcessFile(const TString& path, AliMpDataMap* dataMap)
   // cut top path
   string top = AliMpFiles::GetTop().Data();
   string fullDataPath = path.Data();
-  string dataPath = string(fullDataPath, top.size()+6);
+  string dataPath = fullDataPath;
+  if ( dataPath.find(top) != string::npos ) dataPath.erase(0, top.size()+1);
+  dataPath.erase(0,dataPath.find('/')+1); 
   
   AliDebugStream(2) << "Processing file " << dataPath << endl;
 
@@ -242,7 +244,7 @@ AliMpDataMap* AliMpDataProcessor::CreateDataMap(const TString& dataDir)
 /// the file path.
 
   TString curDir = gSystem->pwd();
-
+  
   AliMpDataMap* dataMap = new AliMpDataMap();
 
   TString dataPath = AliMpFiles::GetTop() + "/" + dataDir;
index 4820a67..4393117 100644 (file)
@@ -21,7 +21,7 @@
 // Class AliMpDataStreams
 // ----------------------
 // Class for providing mapping data streams
-// Se detailed description in the header file.
+// See detailed description in the header file.
 // Author: Ivana Hrivnacova; IPN Orsay
 //-----------------------------------------------------------------------------
 
 ClassImp(AliMpDataStreams)
 /// \endcond
 
-AliMpDataStreams* AliMpDataStreams::fgInstance = 0;
-
-//
-// static methods
-//
 
 //______________________________________________________________________________
-AliMpDataStreams* AliMpDataStreams::Instance()
+AliMpDataStreams::AliMpDataStreams(AliMpDataMap* map) 
+  : TObject(),
+    fMap(map),
+    fReadFromFiles(kTRUE)
 {
-/// Return its instance
-
-  if ( ! fgInstance ) {
-    fgInstance = new AliMpDataStreams();
-  }  
-    
-  return fgInstance;
-}    
-
-//
-// ctor, dtor
-//
+/// Standard and default constructor
 
+  if ( map ) fReadFromFiles = kFALSE;
+}
 
 //______________________________________________________________________________
-AliMpDataStreams::AliMpDataStreams() 
+AliMpDataStreams::AliMpDataStreams(TRootIOCtor* /*ioCtor*/) 
   : TObject(),
     fMap(0),
-    fReadFromFiles(kTRUE)
+    fReadFromFiles()
 {
-/// Standard and default constructor
+/// Root IO constructor
 
 }
 
@@ -81,41 +70,30 @@ AliMpDataStreams::~AliMpDataStreams()
 {
 /// Destructor
 
-  delete fMap;
-
-  fgInstance = 0;
+  // delete fMap;
+       // Do not delete data map as it is a CDB object 
+       // which is cached
 }
 
 //
-// public methods
+// private methods
 //
 
-/*
 //______________________________________________________________________________
-TString AliMpDataStreams::GetDataStream(const TString& path) const
-{
-/// Return the string with data in the mapping file spcified with path
+void AliMpDataStreams::CutDataPath(string& dataPath) const
+{ 
+/// Cut the path defined in AliMpFiles as Top() + one more directory
 
-  // Cut top from the path 
   string top = AliMpFiles::GetTop().Data();
-  string fullDataPath = path.Data();
-  string dataPath = string(fullDataPath, top.size()+1);
-
-  cout << "Go to get value for " << dataPath.c_str() << endl;
-  
-  // Find string object in the map
-  TObject* object = fMap->GetValue(dataPath.c_str());
-  if ( ! object ) {
-    AliErrorStream() 
-      << "Cannot find data for mapping file " << dataPath << endl;
-    return "";
-  }   
-  
-  cout << "Got: " << object << endl;   
-  
-  return ((TObjString*)object)->String();
+  if ( dataPath.find(top) != string::npos ) dataPath.erase(0, top.size()+1);
+  dataPath.erase(0,dataPath.find('/')+1); 
 }
-*/
+  
+
+
+//
+// public methods
+//
 
 //______________________________________________________________________________
 istream& AliMpDataStreams::CreateDataStream(const TString& path) const
@@ -139,11 +117,8 @@ istream& AliMpDataStreams::CreateDataStream(const TString& path) const
     AliDebugStream(2) << "Opening stream " << path.Data() << endl;
 
     // Cut top from the path 
-    string top = AliMpFiles::GetTop().Data();
-    string fullDataPath = path.Data();
-    string dataPath = fullDataPath;
-    if ( dataPath.find(top) != string::npos )
-      dataPath.erase(0, top.size()+6);
+    string dataPath = path.Data();
+    CutDataPath(dataPath);
 
     istringstream* stringBuffer 
       = new istringstream(fMap->Get(dataPath).Data());
@@ -162,45 +137,19 @@ Bool_t  AliMpDataStreams::IsDataStream(const TString& path) const
   }
   else {
     // Cut top from the path 
-    string top = AliMpFiles::GetTop().Data();
-    string fullDataPath = path.Data();
-    string dataPath = fullDataPath;
-    if ( dataPath.find(top) != string::npos )
-      dataPath.erase(0, top.size()+6);
-
-    // std::map implementation
-    // return fMap->GetMap().find(dataPath) != fMap->GetMap().end();
+    string dataPath = path.Data();
+    CutDataPath(dataPath);
+
     return ( fMap->Get(dataPath, kFALSE) != "" );
   }
 }      
 
-
 //______________________________________________________________________________
-void  AliMpDataStreams::SetDataMap(AliMpDataMap* map)
-{
-/// Set the data map and switch off readFromFiles
-
-  if ( fMap && fMap != map ) delete fMap;
-
-  fMap = map;
-  fReadFromFiles = kFALSE;
-}  
-
-//______________________________________________________________________________
-void  AliMpDataStreams::SetReadFromFiles(Bool_t readFromFiles)
+void  AliMpDataStreams::SetReadFromFiles()
 {
 /// Set option to read data from files
 
-  if ( ! fMap && ! readFromFiles ) {
-    AliWarningStream()
-      << "Setting ignored: " << endl
-      << "Selected reading from streams, but data map has not been yet defined"
-      << endl;
-      
-    return;  
-  }     
-
-  fReadFromFiles = readFromFiles;
+  fReadFromFiles = kTRUE;
 }  
 
 //______________________________________________________________________________
index 270ce45..53dcace 100644 (file)
 ///
 /// The class provides input streams for mapping data;
 /// the input streams can be represented either by the
-/// data files or by string streams filled from AliMpDataMap.
-/// The string map is set from outside (AliMpCDB).
-/// The data stream must be deleted by client code.
+/// data files or by string streams filled from string map (AliMpDataMap).
+/// The string map is set from outside (AliMpCDB) and is not
+/// deleted in this class.
+/// The data streams returned by CreateDataStream() function
+/// must be deleted by the client code.
 ///
-/// The selection between files and string streams can
-/// be done via function:                                  \n 
-/// void   SetReadFromFiles(Bool_t readFromFiles);
+/// The selection between files and string streams is 
+/// done in the constructor:
+/// if data map is provided, reading is performed from streams,
+/// otherwise reading is performed from file.
+/// User can also use the set function to select reading
+/// from files also when the data map is provided: \n
+/// void SetReadFromFiles();
 ///
 /// \author Ivana Hrivnacova; IPN Orsay
 
@@ -37,19 +43,16 @@ class AliMpDataMap;
 class AliMpDataStreams : public TObject
 {
   public:
-    AliMpDataStreams();
+    AliMpDataStreams(AliMpDataMap* map = 0x0);
+    AliMpDataStreams(TRootIOCtor* ioCtor);
     virtual ~AliMpDataStreams();
   
-    // static methods
-    static AliMpDataStreams* Instance();
-
     // methods
     istream& CreateDataStream(const TString& path) const; 
     Bool_t   IsDataStream(const TString& path) const; 
   
     // set methods
-    void   SetDataMap(AliMpDataMap* map);
-    void   SetReadFromFiles(Bool_t readFromFiles);
+    void   SetReadFromFiles();
     Bool_t GetReadFromFiles() const;
 
   private: 
@@ -58,11 +61,10 @@ class AliMpDataStreams : public TObject
     /// Not implemented
     AliMpDataStreams& operator=(const AliMpDataStreams& right);    
 
-    // static data members
-    static AliMpDataStreams* fgInstance; ///< Singleton instance
+    // methods
+    void CutDataPath(string& dataPath) const;
 
     // data members
-    // TMap* fMap;
     AliMpDataMap*  fMap;           ///< data map
     Bool_t         fReadFromFiles; ///< option for reading data from files
     
index 1948c9f..48dbc15 100644 (file)
@@ -58,8 +58,6 @@ AliMpDetElement::AliMpDetElement(Int_t id, const TString& name,
     fSegType(segType),
     fPlaneType(planeType),
     fBusPatchIds(false),
-    fManuToSerialNbs(),
-    fSerialNbToManus(),
     fManuList(),
     fTrackerChannels(),
     fHVmanus(),
@@ -77,8 +75,6 @@ AliMpDetElement::AliMpDetElement(TRootIOCtor* ioCtor)
     fSegType(),
     fPlaneType(),
     fBusPatchIds(),
-    fManuToSerialNbs(),
-    fSerialNbToManus(),
     fManuList(),
     fTrackerChannels(),
     fHVmanus(ioCtor),
@@ -116,21 +112,6 @@ Bool_t AliMpDetElement::AddBusPatch(Int_t busPatchId)
 }  
  
 //______________________________________________________________________________
-void AliMpDetElement::AddManuSerial(Int_t manuId, Int_t serialNb)
-{
-/// Map the serial manu number 
-/// (Eventually add check if the given pair already present)
-
-  AliCodeTimerAuto("");
-  
-  AliDebug(1,Form("DE %4d ManuId %4d SerialNB %d",
-               fId,manuId,serialNb));
-  
-  fManuToSerialNbs.Add(Long_t(manuId), Long_t(serialNb)); 
-  fSerialNbToManus.Add(Long_t(serialNb), Long_t(manuId));
-}      
-
-//______________________________________________________________________________
 TString AliMpDetElement::GetSegName(AliMp::CathodType cathType) const
 {
 /// Return the segmentation name for the given catod type
@@ -224,22 +205,6 @@ Bool_t  AliMpDetElement::HasBusPatchId(Int_t busPatchId) const
 }
 
 //______________________________________________________________________________
-Int_t  AliMpDetElement::GetManuSerialFromId(Int_t manuId) const
-{
-/// Return manu serial number from manuId
-
-  return (Int_t)fManuToSerialNbs.GetValue(Long_t(manuId));
-}
-
-//______________________________________________________________________________
-Int_t  AliMpDetElement::GetManuIdFromSerial(Int_t serialNb) const
-{
-/// Return manuId from manu serial number
-  
-  return (Int_t)fSerialNbToManus.GetValue(Long_t(serialNb));
-}
-
-//______________________________________________________________________________
 Int_t 
 AliMpDetElement::NofChannelsInManu(Int_t manuId) const
 {
@@ -366,14 +331,6 @@ AliMpDetElement::ManusForHV(Int_t hvIndex) const
 
 //______________________________________________________________________________
 Int_t 
-AliMpDetElement::NofManusWithSerialNumber() const
-{
-  /// Return the number of manus which have a serial number in this detection element  
-  return fManuToSerialNbs.GetSize();
-}
-
-//______________________________________________________________________________
-Int_t 
 AliMpDetElement::NofManus() const
 {
   /// Return the number of manus in this detection element
index 6df7be3..4f9b573 100644 (file)
@@ -43,7 +43,6 @@ class AliMpDetElement : public  TObject {
     
     // methods
     Bool_t AddBusPatch(Int_t busPatchId); 
-    void   AddManuSerial(Int_t manuId, Int_t serialNb); 
     void   AddManu(Int_t manuId);
     void   SetDdlId(Int_t ddlId);
 
@@ -62,10 +61,6 @@ class AliMpDetElement : public  TObject {
     Int_t  GetNofBusPatches() const;
     Int_t  GetBusPatchId(Int_t index) const;
     Bool_t HasBusPatchId(Int_t busPatchId) const;
-    
-    Int_t  NofManusWithSerialNumber() const;
-    Int_t  GetManuSerialFromId(Int_t manuId) const;
-    Int_t  GetManuIdFromSerial(Int_t serialNb) const;
 
     Int_t  NofManus() const;
     Int_t  NofChannelsInManu(Int_t manuId) const;
@@ -96,8 +91,6 @@ class AliMpDetElement : public  TObject {
     AliMp::PlaneType fPlaneType;  ///< Plane type on cathod0
     //AliMpExMap     fBusPatches; ///< Bus patches connected to this detection element
     AliMpArrayI    fBusPatchIds;  ///< Bus patches connected to this detection element
-    mutable TExMap fManuToSerialNbs; ///< Map from manuId to serial #   
-    mutable TExMap fSerialNbToManus; ///< Map manu serial # to manuId
     
     mutable TExMap fManuList;  ///< map of manus
     mutable TExMap fTrackerChannels; ///< list of connected pads (tracker only)
@@ -106,7 +99,7 @@ class AliMpDetElement : public  TObject {
     
     Int_t fNofChannels; ///< number of channels in this detection element
     
-  ClassDef(AliMpDetElement,3)  // The manager class for definition of detection element types
+  ClassDef(AliMpDetElement,4)  // The manager class for definition of detection element types
 };
 
 // inline function
index dcab98c..c4890da 100755 (executable)
@@ -49,6 +49,7 @@ ClassImp(AliMpFiles)
 // static data members
 
 const TString AliMpFiles::fgkDataDir = "/data";
+const TString AliMpFiles::fgkDataRunDir = "/data_run";
 const TString AliMpFiles::fgkStationDir = "/station";
 const TString AliMpFiles::fgkBendingDir = "bending_plane/";
 const TString AliMpFiles::fgkNonBendingDir = "non-bending_plane/";
@@ -58,7 +59,6 @@ const TString AliMpFiles::fgkSectorSpecial = "zones_special";
 const TString AliMpFiles::fgkSectorSpecial2 = "zones_special_outer";
 const TString AliMpFiles::fgkMotifPrefix   = "motif";  
 const TString AliMpFiles::fgkMotifSpecialPrefix ="motifSpecial";
-const TString AliMpFiles::fgkManuToSerialDir ="manu_serial/";
 const TString AliMpFiles::fgkManuToSerial ="_manu";
 const TString AliMpFiles::fgkPadPosPrefix  = "padPos"; 
 const TString AliMpFiles::fgkDataExt = ".dat";      
@@ -323,8 +323,8 @@ TString AliMpFiles::ManuToSerialPath(const TString& deName, AliMp::StationType s
 {
 /// Returns the path of the file for the manu id to their serial number
 
-  return  GetTop() + fgkDataDir + StationDataDir(station)
-              + fgkManuToSerialDir + deName + fgkManuToSerial + fgkDataExt; 
+  return  GetTop() + fgkDataRunDir + StationDataDir(station)
+              + deName + fgkManuToSerial + fgkDataExt; 
 }
 
 
index cd13a6f..48eceb9 100755 (executable)
@@ -85,6 +85,9 @@ class AliMpFiles : public TObject
 
     static TString SerialToBinFilePath();
 
+    static TString PlaneDataDir(AliMp::StationType station, AliMp::PlaneType plane); 
+    static TString StationDataDir(AliMp::StationType station); 
+  
     // set methods
     static void SetTopPath(const TString& topPath);
     static TString GetTop();
@@ -97,12 +100,9 @@ class AliMpFiles : public TObject
     /// Not implemented
     AliMpFiles& operator=(const AliMpFiles& right);    
 
-    // methods
-    static TString PlaneDataDir(AliMp::StationType station, AliMp::PlaneType plane); 
-    static TString StationDataDir(AliMp::StationType station); 
-  
     // static data members  
     static const TString fgkDataDir;       ///< data directory
+    static const TString fgkDataRunDir;    ///< directory for run dependent data
     static const TString fgkStationDir;    ///< station directory
     static const TString fgkBendingDir;    ///< bending plane directory
     static const TString fgkNonBendingDir; ///< non-bending plane directory
@@ -112,7 +112,6 @@ class AliMpFiles : public TObject
     static const TString fgkSectorSpecial2;///< sector special data file name
     static const TString fgkMotifPrefix;   ///< motif data file name
     static const TString fgkMotifSpecialPrefix; ///< special motif data file name 
-    static const TString fgkManuToSerialDir;///< manu to serial file directory
     static const TString fgkManuToSerial;  ///< manu to serial file name suffix
     static const TString fgkPadPosPrefix;  ///< pad position data file name
     static const TString fgkDataExt;       ///< file extension
diff --git a/MUON/mapping/AliMpManuStore.cxx b/MUON/mapping/AliMpManuStore.cxx
new file mode 100644 (file)
index 0000000..08e51eb
--- /dev/null
@@ -0,0 +1,435 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, 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.                  *
+ **************************************************************************/
+
+// $Id$
+// Category: management
+
+//-----------------------------------------------------------------------------
+// Class AliMpManuStore
+// --------------------
+// The container class for manu serial numbersd
+// Authors: Ivana Hrivnacova, IPN Orsay
+//          Christian Finck, SUBATECH Nantes
+//-----------------------------------------------------------------------------
+
+#include "AliMpManuStore.h"
+
+#include "AliMpDEStore.h"
+#include "AliMpDEManager.h"
+#include "AliMpDetElement.h"
+#include "AliMpConstants.h"
+#include "AliMpDataStreams.h"
+#include "AliMpFiles.h"
+#include "AliMpHelper.h"
+#include "AliMpIntPair.h"
+#include "AliMpConstants.h"
+
+#include "AliLog.h"
+
+#include <Riostream.h>
+#include <TClass.h>
+#include <TSystem.h>
+#include <TObjString.h>
+#include <TObjArray.h>
+#include <TMap.h>
+
+#include <fstream>
+
+/// \cond CLASSIMP
+ClassImp(AliMpManuStore)
+/// \endcond
+
+AliMpManuStore* AliMpManuStore::fgInstance = 0;
+Bool_t          AliMpManuStore::fgWarnIfDoublon = kFALSE;
+
+//
+// static methods
+//
+
+//______________________________________________________________________________
+AliMpManuStore* AliMpManuStore::Instance(Bool_t warn) 
+{
+    /// Create the DDL store if it does not yet exist
+    /// and return its instance
+
+    if ( ! fgInstance && warn  ) {
+        AliWarningClass("Manu Store has not been loaded");
+    }
+
+    return fgInstance;
+}
+
+//______________________________________________________________________________
+AliMpManuStore* AliMpManuStore::ReadData(const AliMpDataStreams& dataStreams, 
+                                         Bool_t warn) 
+{
+    /// Load the DDL store from ASCII data files
+    /// and return its instance
+
+    if ( fgInstance ) {
+        if ( warn )
+            AliWarningClass("DDL Store has been already loaded");
+        return fgInstance;
+    }
+
+    if ( dataStreams.GetReadFromFiles() )
+      AliInfoClass("Reading Manu Store from ASCII files.");
+
+    fgInstance = new AliMpManuStore(dataStreams);
+    return fgInstance;
+}
+
+//
+// ctors, dtor
+//
+
+
+//______________________________________________________________________________
+AliMpManuStore::AliMpManuStore(const AliMpDataStreams& dataStreams)
+: TObject(),
+  fDataStreams(dataStreams),
+  fManuToSerialNbs(),
+  fSerialNbToManus(),
+  fNofManusInDE(),
+  fNofManus(0)
+{  
+/// Standard constructor
+
+  AliDebug(1,"");
+
+  // Check if DE store is loaded
+  if ( ! AliMpDEStore::Instance(false) ) {
+     AliErrorStream()
+       << "Mapping segmentation has not be loaded. Cannont load Manu store"
+       << endl;
+     return;
+  }      
+
+  ReadManuSerial();
+}
+
+//______________________________________________________________________________
+AliMpManuStore::AliMpManuStore(TRootIOCtor* ioCtor)
+: TObject(),
+  fDataStreams(ioCtor),
+  fManuToSerialNbs(),
+  fSerialNbToManus(),
+  fNofManusInDE(),
+  fNofManus(0)
+{  
+/// Constructor for IO
+
+  AliDebug(1,"");
+}
+
+
+//______________________________________________________________________________
+AliMpManuStore::~AliMpManuStore()
+{
+/// Destructor
+
+  AliDebug(1,"");
+}
+
+//
+// private methods
+//
+
+//______________________________________________________________________________
+Bool_t AliMpManuStore::ReadData(const AliMpDetElement* de, Int_t& nofManus)
+{
+/// Read manu serial numbers for the given detection element
+
+  Int_t deId = de->GetId();
+  TString deName = de->GetDEName();
+  AliMp::StationType stationType 
+    =  AliMpDEManager::GetStationType(de->GetId());
+
+  // Nothing to be done for trigger
+  if ( stationType == AliMp::kStationTrigger ) {
+    nofManus = 0;
+    return kTRUE;
+  }  
+
+  static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
+
+  istream& in 
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::ManuToSerialPath(deName, stationType));
+
+  char line[80];
+
+  nofManus = 0;
+  while ( in.getline(line,80) ) {
+
+    if ( line[0] == '#' ) continue;
+
+    TString tmp(AliMpHelper::Normalize(line));
+
+    TObjArray* stringList = tmp.Tokenize(TString(" "));
+
+    Int_t manuId     = atoi( ((TObjString*)stringList->At(0))->GetName());
+    Int_t manuSerial = atoi( ((TObjString*)stringList->At(2))->GetName());
+      
+    TString sPlane = ((TObjString*)stringList->At(1))->GetString();
+
+    // filling manuId <> manuSerial
+    if (!sPlane.CompareTo(PlaneTypeName(AliMp::kBendingPlane)))
+       AddManu(deId, manuId, manuSerial);
+    else 
+       AddManu(deId, manuId + manuMask, manuSerial);
+        
+    ++nofManus;    
+
+    delete stringList;
+  }
+   
+  return kTRUE;
+}
+
+//______________________________________________________________________________
+Bool_t  AliMpManuStore::ReadManuSerial()
+{
+/// Read data files for all detection elements.
+/// Return true if reading was successful.
+
+  Bool_t isOk = kTRUE;
+
+  // Loop over DE
+  AliMpDEIterator it;
+  for ( it.First(); ! it.IsDone(); it.Next() ) {
+
+    AliMpDetElement* detElement = it.CurrentDE();
+
+    Int_t nofManus;
+    Bool_t result = ReadData(detElement, nofManus);  
+    fNofManusInDE.Add(detElement->GetId(), nofManus);
+    fNofManus += nofManus;
+    
+    AliDebugStream(2) 
+      << "Adding " << nofManus << " manus for de " 
+      << detElement->GetId() << endl;
+    
+    isOk = isOk && result;
+  }
+  
+  return isOk;  
+}   
+
+//______________________________________________________________________________
+void  AliMpManuStore::ReplaceManu(Int_t detElemId, Int_t manuId, Int_t serialNb) 
+{
+/// Replace manu in the map.
+/// As TExMap has no replcae function, we have to rebuild map once again.
+/// Not yet in use, declared private.
+
+  Long_t index = AliMpExMap::GetIndex(AliMpIntPair(detElemId, manuId));
+
+  TExMap newManuToSerialNbs;
+  // Loop over map
+  TExMapIter it(&fManuToSerialNbs);
+  Long_t key;
+  Long_t value;
+  while ( ( it.Next(key, value) ) ) {
+
+    if ( key != index ) 
+      newManuToSerialNbs.Add(key, value);
+    else
+      newManuToSerialNbs.Add(index, Long_t(serialNb));
+  }
+      
+  TExMap newSerialNbToManus;
+  // Loop over map
+  TExMapIter it2(&fSerialNbToManus);
+  while ( ( it2.Next(key, value) ) ) {
+
+    if ( value != index ) 
+      newSerialNbToManus.Add(key, value);
+    else
+      newSerialNbToManus.Add(Long_t(serialNb), index);
+  }
+
+  // And now replace the maps
+  fManuToSerialNbs = newManuToSerialNbs;
+  fSerialNbToManus = newManuToSerialNbs;
+}     
+
+
+//______________________________________________________________________________
+Bool_t  AliMpManuStore::WriteData(const TString& outDir)
+{
+/// Write data files for all detection elements.
+/// Return true if reading was successful.
+/// Not yet in use, declared private.
+
+  TString curDir = gSystem->pwd();
+
+  // Create top directory
+  //
+  if ( gSystem->OpenDirectory(outDir.Data()) ) {
+    AliErrorStream() 
+      << "Directory " << outDir.Data() << " already exists" << endl;
+    return kFALSE;
+  }
+  else {
+    AliDebugStream(2) << "Making directory " <<  outDir.Data() << endl;
+    gSystem->mkdir(outDir.Data());
+  }  
+
+  // Loop over DE
+  AliMpDEIterator it;
+  for ( it.First(); ! it.IsDone(); it.Next() ) {
+  
+    AliMpDetElement* detElement = it.CurrentDE();
+    Int_t detElemId = detElement->GetId();
+    TString deName = detElement->GetDEName();
+    AliMp::StationType stationType 
+      =  AliMpDEManager::GetStationType(detElemId);
+      
+    if ( stationType == AliMp::kStationTrigger ) continue;  
+
+    // Create directory if it does not yet exist
+    //
+    TString dirPath = outDir + AliMpFiles::StationDataDir(stationType);
+    if ( ! gSystem->OpenDirectory(dirPath.Data()) ) {
+      AliDebugStream(2) << "Making directory " <<  dirPath.Data() << endl;
+      gSystem->mkdir(dirPath.Data());
+    }  
+
+    // Compose output file path 
+    //
+    string dataPath = AliMpFiles::ManuToSerialPath(deName, stationType).Data();
+    string top = AliMpFiles::GetTop().Data();
+    if ( dataPath.find(top) != string::npos ) dataPath.erase(0, top.size()+1);
+    dataPath.erase(0,dataPath.find('/')+1);
+    TString filePath = outDir + "/" + dataPath; 
+
+    // Open file
+    //
+    ofstream out(filePath.Data());
+    if ( ! out.good() ) {
+      AliErrorStream() 
+        << "Cannot open output file  " << filePath.Data() << endl;
+      return kFALSE;  
+    }
+    
+    // Loop over map
+    TExMapIter it(&fManuToSerialNbs);
+    Long_t key;
+    Long_t value;
+    while ( ( it.Next(key, value) ) ) {
+      AliMpIntPair pair = AliMpExMap::GetPair(key);
+      
+      if ( pair.GetFirst() != detElemId ) continue;
+      
+      AliDebugStream(3) 
+        << "Go to write " << key << " " << pair << " " << value << endl;
+
+      Int_t manuId = pair.GetSecond();
+      static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
+
+      TString planeName = PlaneTypeName(AliMp::kBendingPlane);
+      if ( pair.GetSecond()> manuMask ) {
+        planeName = PlaneTypeName(AliMp::kNonBendingPlane);
+        manuId -= manuMask;
+      } 
+      out << manuId << " " << planeName.Data() <<  " " << value << endl;
+      
+      AliDebugStream(3) 
+        << manuId << " " << planeName.Data() <<  " " << value << endl;
+    }  
+    out.close();
+  }   
+  gSystem->cd(curDir); 
+  return kTRUE;  
+}   
+
+//
+// public methods
+//
+
+
+//______________________________________________________________________________
+Int_t  AliMpManuStore::NofManus() const
+{ 
+/// Return total number of manus in the store
+
+  return fNofManus;
+}  
+  
+
+//______________________________________________________________________________
+Int_t  AliMpManuStore::NofManus(Int_t detElemId) const 
+{ 
+/// Return number of manus in given detection element
+
+   if ( ! AliMpDEManager::IsValidDetElemId(detElemId, kTRUE) ) return 0;   
+
+   return fNofManusInDE.GetValue(detElemId); 
+}
+
+//______________________________________________________________________________
+Bool_t  AliMpManuStore::AddManu(Int_t detElemId, Int_t manuId, Int_t serialNb) 
+{
+/// Add manu to the map
+
+  Long_t index = AliMpExMap::GetIndex(AliMpIntPair(detElemId, manuId));
+  
+  AliDebugStream(2)
+    << "Adding (" << detElemId << "," <<  manuId 
+    << ") as index=" << index << " and serialNb=" << serialNb << endl;
+  
+  fManuToSerialNbs.Add(index, Long_t(serialNb));
+  
+  Long_t value = fSerialNbToManus.GetValue(Long_t(serialNb));
+  if ( value ) {
+    if ( fgWarnIfDoublon ) {
+      AliWarningStream() 
+        << "Serial number " << serialNb 
+        << " already present for (detElemId, manuId) = " << AliMpExMap::GetPair(value)
+        << ", it will nod be added for (" 
+        << detElemId << "," << manuId << ")" << endl;
+     }
+     return kFALSE;    
+  }
+  else {
+    fSerialNbToManus.Add(Long_t(serialNb), index);
+    return kTRUE;
+  }  
+}     
+
+
+//______________________________________________________________________________
+Int_t AliMpManuStore::GetManuSerial(Int_t detElemId, Int_t manuId) const
+{
+/// Return manu serial number for given detElemId and manuId
+
+  Long_t index = AliMpExMap::GetIndex(AliMpIntPair(detElemId, manuId));
+  // cout << index << " " << fManuToSerialNbs.GetValue(index) << endl;
+  
+  return fManuToSerialNbs.GetValue(index);
+}  
+
+//______________________________________________________________________________
+AliMpIntPair  AliMpManuStore::GetDetElemIdManu(Int_t manuSerial) const
+{
+/// Return detElemId and manuId for given manu serial number 
+
+  Long_t value = fSerialNbToManus.GetValue(Long_t(manuSerial));
+  // cout << manuSerial << " " << value << endl;
+  
+  return AliMpExMap::GetPair(value);
+}  
+
diff --git a/MUON/mapping/AliMpManuStore.h b/MUON/mapping/AliMpManuStore.h
new file mode 100644 (file)
index 0000000..3b99ee7
--- /dev/null
@@ -0,0 +1,108 @@
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// $Id$
+// $MpId: AliMpManuStore.h,v 1.6 2006/05/24 13:58:16 ivana Exp $ 
+
+/// \ingroup management
+/// \class AliMpManuStore
+/// \brief The container class for manu serial numbers
+///
+/// \author Ivana Hrivnacova, IPN Orsay; Christian Finck, SUBATECH Nantes
+
+#ifndef ALI_MP_MANU_STORE_H
+#define ALI_MP_MANU_STORE_H
+
+#include <TObject.h>
+
+#include "AliMpPlaneType.h"
+#include "AliMpStationType.h"
+#include "AliMpIntPair.h"
+
+#include <TString.h>
+#include <TExMap.h>
+
+class AliMpDetElement;
+class AliMpDataStreams;
+class TString;
+
+class AliMpManuStore : public  TObject {
+
+  public:
+    AliMpManuStore(TRootIOCtor* /*ioCtor*/);
+    virtual ~AliMpManuStore();
+    
+    // static access method
+    static AliMpManuStore* Instance(Bool_t warn = true); 
+    static AliMpManuStore* ReadData(const AliMpDataStreams& dataStreams,
+                                    Bool_t warn = true);
+                                    
+    static void SetWarnIfDoublon(Bool_t warn);                             
+    
+    
+    // methods
+    Bool_t  AddManu(Int_t detElemId, Int_t manuId, Int_t serialNb);
+
+    Int_t  NofManus() const;
+    Int_t  NofManus(Int_t detElemId) const;
+
+    Int_t  GetManuSerial(Int_t detElemId, Int_t manuId) const;
+    AliMpIntPair  GetDetElemIdManu(Int_t manuSerial) const;
+
+  private:
+    AliMpManuStore(const AliMpDataStreams& dataStreams);
+     /// Not implemented
+    AliMpManuStore();
+     /// Not implemented
+    AliMpManuStore(const AliMpManuStore& rhs);
+    /// Not implemented
+    AliMpManuStore& operator=(const AliMpManuStore& rhs);
+    // methods
+    Bool_t ReadData(const AliMpDetElement* detElement, Int_t& nofManus);
+    Bool_t ReadManuSerial();
+    
+    // not yet in use methods
+    void   ReplaceManu(Int_t detElemId, Int_t manuId, Int_t serialNb);
+    Bool_t WriteData(const TString& outDir = "data_run_out");
+
+    // static data members     
+    static AliMpManuStore* fgInstance;      ///< Singleton instance
+    static Bool_t          fgWarnIfDoublon; ///< Option to warn about doublons
+
+    // data members    
+    const AliMpDataStreams& fDataStreams; //!< Data streams
+    mutable TExMap fManuToSerialNbs; ///< Map from manuId to serial #   
+    mutable TExMap fSerialNbToManus; ///< Map manu serial # to manuId
+    mutable TExMap fNofManusInDE;    ///< Number of manus with serial nbs in DE
+    Int_t          fNofManus;        ///< Total number of manus
+      
+  ClassDef(AliMpManuStore,1)  // The manager class for definition of detection element types
+};
+
+// inline functions
+
+inline void AliMpManuStore::SetWarnIfDoublon(Bool_t warn) 
+{ 
+/// Set option to warn if the same serial number is present for more manus
+
+  fgWarnIfDoublon = warn; 
+}                                   
+    
+    
+#endif //ALI_MP_MANU_STORE_H
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
index 14450d1..986d9c7 100644 (file)
@@ -51,9 +51,11 @@ ClassImp(AliMpMotifReader)
 /// \endcond
 
 //_____________________________________________________________________________
-AliMpMotifReader::AliMpMotifReader(AliMp::StationType station, 
+AliMpMotifReader::AliMpMotifReader(const AliMpDataStreams& dataStreams,
+                                   AliMp::StationType station, 
                                    AliMp::PlaneType plane) 
   : TObject(),
+    fDataStreams(dataStreams),
     fStationType(station),
     fPlaneType(plane)
 {
@@ -61,15 +63,6 @@ AliMpMotifReader::AliMpMotifReader(AliMp::StationType station,
 }
 
 //_____________________________________________________________________________
-AliMpMotifReader::AliMpMotifReader() 
-  : TObject(),
-    fStationType(AliMp::kStation1),
-    fPlaneType(AliMp::kBendingPlane)
-{
-/// Default constructor
-}
-
-//_____________________________________________________________________________
 AliMpMotifReader::~AliMpMotifReader() 
 {
 /// Destructor  
@@ -90,16 +83,16 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
   // Open streams
   //
   istream& padPosStream 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::PadPosFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::PadPosFilePath(
                             fStationType,fPlaneType, motifTypeId));
   istream& bergToGCStream 
-    = AliMpDataStreams::Instance()
-      ->CreateDataStream(AliMpFiles::BergToGCFilePath(fStationType));
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::BergToGCFilePath(fStationType));
       
   istream& motifTypeStream 
-    = AliMpDataStreams::Instance()
-      ->CreateDataStream(AliMpFiles::MotifFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::MotifFilePath(
                             fStationType, fPlaneType, motifTypeId));
 
   AliMpMotifType*  motifType = new AliMpMotifType(motifTypeId);        
@@ -267,8 +260,8 @@ AliMpMotifReader::BuildMotifSpecial(const TString& motifID,
   // Open streams
   //
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::MotifSpecialFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::MotifSpecialFilePath(
                              fStationType,fPlaneType, motifID));
 
   TString id = MotifSpecialName(motifID,scale);
index d1f1b3e..9ce0654 100644 (file)
@@ -38,6 +38,7 @@ class AliMpMotifMap;
 class AliMpVMotif;
 class AliMpMotifSpecial;
 class AliMpMotifType;
+class AliMpDataStreams;
 
 class AliMpMotifReader : public TObject
 {
@@ -54,8 +55,8 @@ class AliMpMotifReader : public TObject
 #endif    
 
   public:
-    AliMpMotifReader(AliMp::StationType station, AliMp::PlaneType plane);
-    AliMpMotifReader();
+    AliMpMotifReader(const AliMpDataStreams& dataStreams,
+                     AliMp::StationType station, AliMp::PlaneType plane);
     virtual ~AliMpMotifReader();
   
     // methods   
@@ -67,11 +68,14 @@ class AliMpMotifReader : public TObject
     
   private:
     /// Not implemented
+    AliMpMotifReader();
+    /// Not implemented
     AliMpMotifReader(const AliMpMotifReader& right);
     /// Not implemented
     AliMpMotifReader&  operator = (const AliMpMotifReader& right);
 
     // data members  
+    const AliMpDataStreams& fDataStreams; ///< data streams
     AliMp::StationType  fStationType; ///< station type 
     AliMp::PlaneType    fPlaneType;   ///< plane type 
 
index 1e0671b..3f0dbfa 100644 (file)
@@ -205,31 +205,35 @@ Bool_t AliMpRegionalTrigger::ReadData(const TString& fileName)
 /// Load the Regional trigger from ASCII data files
 /// and return its instance
     
-    if ( fileName != "" ) {
-      AliDebugStream(2) << "Read data from file " << fileName.Data() << endl;
+    AliDebugStream(2) << "Read data from file " << fileName.Data() << endl;
     
-      TString inFileName(fileName);
-      inFileName = gSystem->ExpandPathName(inFileName.Data());
-      ifstream inFile(inFileName.Data(), ios::in);
-      if ( ! inFile.good() ) {
-        AliErrorStream()
-           << "Local Trigger Board Mapping File " << fileName.Data() << " not found" << endl;
-        return kFALSE;
-      }
-      
-      return ReadData(inFile);  
-    } 
-    else {
-      AliDebugStream(2) << "Read data from stream " << fileName.Data() << endl;
-      istream& in
-         = AliMpDataStreams::Instance()
-             ->CreateDataStream(AliMpFiles::LocalTriggerBoardMapping());
-             
-      Bool_t result = ReadData(in);
-      
-      delete &in;
-      return result;        
+    TString inFileName(fileName);
+    inFileName = gSystem->ExpandPathName(inFileName.Data());
+    ifstream inFile(inFileName.Data(), ios::in);
+    if ( ! inFile.good() ) {
+      AliErrorStream()
+         << "Local Trigger Board Mapping File " << fileName.Data() << " not found" << endl;
+      return kFALSE;
     }
+    
+    return ReadData(inFile);  
+}
+
+//______________________________________________________________________________
+Bool_t AliMpRegionalTrigger::ReadData(const AliMpDataStreams& dataStreams)
+{
+/// Load the Regional trigger from ASCII data files
+/// and return its instance
+    
+    AliDebugStream(2) << "Read data from stream " << endl;
+    istream& in
+       = dataStreams.
+           CreateDataStream(AliMpFiles::LocalTriggerBoardMapping());
+           
+    Bool_t result = ReadData(in);
+    
+    delete &in;
+    return result;        
 }
 
 //______________________________________________________________________________
index aae160f..b9fca64 100644 (file)
@@ -20,6 +20,7 @@
 
 class AliMpTriggerCrate;
 class AliMpLocalBoard;
+class AliMpDataStreams;
 class TIterator;
 
 class AliMpRegionalTrigger : public  TObject{
@@ -34,7 +35,8 @@ class AliMpRegionalTrigger : public  TObject{
     AliMpRegionalTrigger& operator=(const AliMpRegionalTrigger& rhs);
 
     // methods
-    Bool_t ReadData(const TString& fileName = "");
+    Bool_t ReadData(const TString& fileName);
+    Bool_t ReadData(const AliMpDataStreams& dataStreams);
     
     AliMpTriggerCrate* FindTriggerCrate(TString crateName, Bool_t warn = true) const;
     AliMpLocalBoard*   FindLocalBoard(Int_t localBoardId, Bool_t warn = true) const;
index c7b8466..ce7bb3d 100755 (executable)
@@ -74,30 +74,21 @@ const TString  AliMpSectorReader::fgkPadRowsKeyword        = "PAD_ROWS";
 const TString  AliMpSectorReader::fgkPadRowSegmentKeyword  = "PAD_ROW_SEGMENT";
 
 //_____________________________________________________________________________
-AliMpSectorReader::AliMpSectorReader(AliMp::StationType station, 
+AliMpSectorReader::AliMpSectorReader(const AliMpDataStreams& dataStreams,
+                                     AliMp::StationType station, 
                                      AliMp::PlaneType plane) 
   : TObject(),
+    fDataStreams(dataStreams),
     fStationType(station),
     fPlaneType(plane),
     fSector(0),
-    fMotifReader(new AliMpMotifReader(station, plane))
+    fMotifReader(new AliMpMotifReader(dataStreams, station, plane))
  
 {
 /// Standard constructor
 }
 
 //_____________________________________________________________________________
-AliMpSectorReader::AliMpSectorReader() 
-  : TObject(),
-    fStationType(AliMp::kStation1),
-    fPlaneType(AliMp::kBendingPlane),
-    fSector(0),
-    fMotifReader(0)
-{
-/// Default constructor
-}
-
-//_____________________________________________________________________________
 AliMpSectorReader::~AliMpSectorReader() 
 {
 /// Destructor  
@@ -538,8 +529,8 @@ AliMpSector* AliMpSectorReader::BuildSector()
   // Open input stream
   //
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::SectorFilePath(fStationType,fPlaneType));
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::SectorFilePath(fStationType,fPlaneType));
 
   ReadSectorData(in);
   delete &in;
@@ -552,10 +543,10 @@ AliMpSector* AliMpSectorReader::BuildSector()
   
   TString sectorSpecialFileName 
     = AliMpFiles::SectorSpecialFilePath(fStationType, fPlaneType);
-  if ( AliMpDataStreams::Instance()-> IsDataStream(sectorSpecialFileName) ) {
+  if ( fDataStreams.IsDataStream(sectorSpecialFileName) ) {
     istream& in2 
-      = AliMpDataStreams::Instance()
-         ->CreateDataStream(sectorSpecialFileName);
+      = fDataStreams.
+          CreateDataStream(sectorSpecialFileName);
   
     ReadSectorSpecialData(in2, AliMp::kLeft);
     
@@ -565,10 +556,10 @@ AliMpSector* AliMpSectorReader::BuildSector()
   // Open input file for special outer zone
   TString sectorSpecialFileName2 
     = AliMpFiles::SectorSpecialFilePath2(fStationType, fPlaneType);
-  if ( AliMpDataStreams::Instance()-> IsDataStream(sectorSpecialFileName2) ) {
+  if ( fDataStreams.IsDataStream(sectorSpecialFileName2) ) {
     istream& in3
-      = AliMpDataStreams::Instance()
-         ->CreateDataStream(sectorSpecialFileName2);
+      = fDataStreams.
+          CreateDataStream(sectorSpecialFileName2);
     
     ReadSectorSpecialData(in3, AliMp::kRight);
     
index 802fb0a..cc3c35f 100755 (executable)
@@ -33,12 +33,13 @@ class AliMpMotifReader;
 class AliMpVMotif;
 class AliMpMotifSpecial;
 class AliMpMotifType;
+class AliMpDataStreams;
 
 class AliMpSectorReader : public TObject
 {
   public:
-    AliMpSectorReader(AliMp::StationType station, AliMp::PlaneType plane);
-    AliMpSectorReader();
+    AliMpSectorReader(const AliMpDataStreams& dataStreams,
+                      AliMp::StationType station, AliMp::PlaneType plane);
     virtual ~AliMpSectorReader();
   
     // methods   
@@ -46,6 +47,8 @@ class AliMpSectorReader : public TObject
     
   private:  
     /// Not implemented
+    AliMpSectorReader();
+    /// Not implemented
     AliMpSectorReader(const AliMpSectorReader& right);
     /// Not implemented
     AliMpSectorReader& operator = (const AliMpSectorReader& right);
@@ -77,6 +80,7 @@ class AliMpSectorReader : public TObject
     static const TString  fgkPadRowSegmentKeyword; ///< pad row segment keyword
   
     // data members  
+    const AliMpDataStreams&  fDataStreams; ///< data streams
     AliMp::StationType  fStationType; ///< station type 
     AliMp::PlaneType    fPlaneType;   ///< plane type 
     AliMpSector*        fSector;      ///< sector
index d948839..fb1466a 100644 (file)
@@ -79,7 +79,8 @@ AliMpSegmentation* AliMpSegmentation::Instance(Bool_t warn)
 }    
 
 //______________________________________________________________________________
-AliMpSegmentation* AliMpSegmentation::ReadData(Bool_t warn)
+AliMpSegmentation* AliMpSegmentation::ReadData(const AliMpDataStreams& dataStreams,
+                                               Bool_t warn)
 {
 /// Load the sementation from ASCII data files
 /// and return its instance
@@ -90,10 +91,10 @@ AliMpSegmentation* AliMpSegmentation::ReadData(Bool_t warn)
     return fgInstance;
   }  
   
-  if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
+  if ( dataStreams.GetReadFromFiles() )
     AliInfoClass("Reading segmentation from ASCII files.");
 
-  fgInstance = new AliMpSegmentation();
+  fgInstance = new AliMpSegmentation(dataStreams);
   return fgInstance;
 }    
 
@@ -102,8 +103,9 @@ AliMpSegmentation* AliMpSegmentation::ReadData(Bool_t warn)
 //
 
 //______________________________________________________________________________
-AliMpSegmentation::AliMpSegmentation()
+AliMpSegmentation::AliMpSegmentation(const AliMpDataStreams& dataStreams)
 : TObject(),
+  fDataStreams(dataStreams),
   fDetElements(0),
   fMpSegmentations(),
   fElCardsMap(),
@@ -115,7 +117,7 @@ AliMpSegmentation::AliMpSegmentation()
   
   // Load DE data
   if ( ! AliMpDEStore::Instance(false) )  
-    AliMpDEStore::ReadData();
+    AliMpDEStore::ReadData(dataStreams);
   fDetElements = AliMpDEStore::Instance();  
 
   // Create mapping segmentations for all detection elements
@@ -142,6 +144,7 @@ AliMpSegmentation::AliMpSegmentation()
 //______________________________________________________________________________
 AliMpSegmentation::AliMpSegmentation(TRootIOCtor* ioCtor)
 : TObject(),
+  fDataStreams(ioCtor),
   fDetElements(0),
   fMpSegmentations(),
   fElCardsMap(ioCtor),
@@ -203,17 +206,17 @@ AliMpSegmentation::CreateMpSegmentation(Int_t detElemId, AliMp::CathodType cath)
   AliMpVSegmentation* mpSegmentation = 0;
 
   if ( stationType == AliMp::kStation1 || stationType == AliMp::kStation2 ) {
-    AliMpSectorReader reader(stationType, planeType);
+    AliMpSectorReader reader(fDataStreams, stationType, planeType);
     AliMpSector* sector = reader.BuildSector();
     mpSegmentation = new AliMpSectorSegmentation(sector, true);
   }
   else if ( stationType == AliMp::kStation345 ) { 
-    AliMpSt345Reader reader;
+    AliMpSt345Reader reader(fDataStreams);
     AliMpSlat* slat = reader.ReadSlat(deTypeName, planeType);
     mpSegmentation =  new AliMpSlatSegmentation(slat, true);
   }
   else if ( stationType == AliMp::kStationTrigger ) {
-    AliMpTriggerReader reader;
+    AliMpTriggerReader reader(fDataStreams);
     AliMpTrigger* trigger = reader.ReadSlat(deTypeName, planeType);
     mpSegmentation = new AliMpTriggerSegmentation(trigger, true);
   }
index b741c81..0114417 100644 (file)
@@ -40,6 +40,7 @@ class AliMpDEStore;
 class AliMpVSegmentation;
 class AliMpSegmentation;
 class AliMpSlatMotifMap;
+class AliMpDataStreams;
 class TRootIOCtor;
 
 class AliMpSegmentation : public  TObject {
@@ -50,7 +51,8 @@ class AliMpSegmentation : public  TObject {
     
     // static methods
     static AliMpSegmentation* Instance(Bool_t warn = true);
-    static AliMpSegmentation* ReadData(Bool_t warn = true);
+    static AliMpSegmentation* ReadData(const AliMpDataStreams& dataStreams, 
+                                       Bool_t warn = true);
 
     // methods
     const AliMpVSegmentation* GetMpSegmentation(
@@ -62,8 +64,7 @@ class AliMpSegmentation : public  TObject {
                                 Bool_t warn = true) const;
     
   private:
-    /// Not implemented
-    AliMpSegmentation();
+    AliMpSegmentation(const AliMpDataStreams& dataStreams);
     /// Not implemented
     AliMpSegmentation(const AliMpSegmentation& rhs);
     /// Not implemented
@@ -78,10 +79,11 @@ class AliMpSegmentation : public  TObject {
     static AliMpSegmentation* fgInstance; ///< Singleton instance
 
     // data members
+    const AliMpDataStreams&  fDataStreams;  //!< Data streams
     AliMpDEStore*      fDetElements;    ///< Detection element store
     AliMpStringObjMap  fMpSegmentations;///< Map of mapping segmentations to DE seg names
     AliMpExMap         fElCardsMap;     ///< Map of el. cards IDs to segmentations
-    AliMpSlatMotifMap* fSlatMotifMap; ///< Map of motif, motifTypes to avoid duplications and allow proper deletion
+    AliMpSlatMotifMap* fSlatMotifMap;   ///< Map of motif, motifTypes to avoid duplications and allow proper deletion
     
   ClassDef(AliMpSegmentation,2)  // The factory for building mapping segmentations
 };
index 3b97d45..ae59f7f 100644 (file)
@@ -56,9 +56,10 @@ ClassImp(AliMpSt345Reader)
 /// \endcond
 
 //_____________________________________________________________________________
-AliMpSt345Reader::AliMpSt345Reader() 
+AliMpSt345Reader::AliMpSt345Reader(const AliMpDataStreams& dataStreams) 
 : 
 TObject(),
+fDataStreams(dataStreams),
 fMotifMap(AliMpSlatMotifMap::Instance())
 {
   ///
@@ -83,11 +84,12 @@ AliMpSt345Reader::ReadPCB(const char* pcbType)
   /// The returned object must be deleted by the client
   
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::SlatPCBFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::SlatPCBFilePath(
                              AliMp::kStation345, pcbType));
  
-  AliMpMotifReader reader(AliMp::kStation345,AliMp::kNonBendingPlane); 
+  AliMpMotifReader reader(fDataStreams, 
+                          AliMp::kStation345,AliMp::kNonBendingPlane); 
   // note that the nonbending
   // parameter is of no use for station345, as far as reading motif is 
   // concerned, as all motifs are supposed to be in the same directory
@@ -161,8 +163,8 @@ AliMpSt345Reader::ReadSlat(const char* slatType, AliMp::PlaneType planeType)
   /// The returned object must be deleted by the client.
   
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::SlatFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::SlatFilePath(
                              AliMp::kStation345, slatType, planeType));
 
   char line[80];
index 41f75aa..52259a4 100644 (file)
 class AliMpSlatMotifMap;
 class AliMpSlat;
 class AliMpPCB;
+class AliMpDataStreams;
 
 class AliMpSt345Reader : public TObject
 {
  public:
-  AliMpSt345Reader();
+  AliMpSt345Reader(const AliMpDataStreams& dataStreams);
   virtual ~AliMpSt345Reader();
 
   AliMpSlat* ReadSlat(const char* slatType, AliMp::PlaneType planeType);
@@ -45,10 +46,13 @@ class AliMpSt345Reader : public TObject
 
 private:
   /// Not implemented
+  AliMpSt345Reader();
+  /// Not implemented
   AliMpSt345Reader(const AliMpSt345Reader& rhs);
   /// Not implemented
   AliMpSt345Reader& operator=(const AliMpSt345Reader& rhs);
 
+  const AliMpDataStreams&  fDataStreams; ///< data streams
   AliMpSlatMotifMap* fMotifMap; //!< storage for motifTypes and motifs...
   
   ClassDef(AliMpSt345Reader,0) // Reader for slat stations mapping files 
index 121b67d..bfc7cd1 100644 (file)
@@ -64,8 +64,9 @@ const TString AliMpTriggerReader::fgkKeywordFlipX("FLIP_X");
 const TString AliMpTriggerReader::fgkKeywordFlipY("FLIP_Y");
 
 //_____________________________________________________________________________
-AliMpTriggerReader::AliMpTriggerReader() 
+AliMpTriggerReader::AliMpTriggerReader(const AliMpDataStreams& dataStreams) 
 : TObject(),
+  fDataStreams(dataStreams),
   fMotifMap(AliMpSlatMotifMap::Instance()),
   fLocalBoardMap()
 {
@@ -467,8 +468,8 @@ AliMpTriggerReader::ReadLines(const char* slatType,
                        srcLine,destLine));
   
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::SlatFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::SlatFilePath(
                              AliMp::kStationTrigger,slatType, planeType));
   
   char line[80];
@@ -545,8 +546,8 @@ AliMpTriggerReader::ReadLocalBoardMapping()
   UShort_t mask;
   
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::LocalTriggerBoardMapping());
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::LocalTriggerBoardMapping());
 
   char line[80];
   Char_t localBoardName[20];
@@ -610,11 +611,12 @@ AliMpTriggerReader::ReadPCB(const char* pcbType)
   }
   
   istream& in 
-    = AliMpDataStreams::Instance()
-       ->CreateDataStream(AliMpFiles::SlatPCBFilePath(
+    = fDataStreams.
+        CreateDataStream(AliMpFiles::SlatPCBFilePath(
                              AliMp::kStationTrigger,pcbName));
  
-  AliMpMotifReader reader(AliMp::kStationTrigger,AliMp::kNonBendingPlane); 
+  AliMpMotifReader reader(fDataStreams,
+                          AliMp::kStationTrigger,AliMp::kNonBendingPlane); 
   // note that the nonbending
   // parameter is of no use for trigger, as far as reading motif is 
   // concerned, as all motifs are supposed to be in the same directory
index 2bb40bb..acb758f 100644 (file)
@@ -33,13 +33,14 @@ class AliMpSlatMotifMap;
 class AliMpSlat;
 class AliMpTrigger;
 class AliMpPCB;
+class AliMpDataStreams;
 
 class TList;
 
 class AliMpTriggerReader : public TObject
 {
  public:
-  AliMpTriggerReader();
+  AliMpTriggerReader(const AliMpDataStreams& dataStreams);
   virtual ~AliMpTriggerReader();
 
   AliMpTrigger* ReadSlat(const char* slatType, AliMp::PlaneType planeType);
@@ -87,6 +88,7 @@ private:
   /// Not implemented
   AliMpTriggerReader& operator=(const AliMpTriggerReader& rhs);
     
+  const AliMpDataStreams&  fDataStreams; //!< data streams
   AliMpSlatMotifMap* fMotifMap; //!< storage for motifTypes and motifs...
   
   TMap fLocalBoardMap; //!< map of TObjString to TObjString