データ - Activate or Deactivate

ヘッダーファイル
$ATLJ_TOP_DIR/include/athena_cbnt/ATHENA_CBNT_Event.h
を見ると分かりますが、public: つまり、全データに直接アクセスできます。
本来のC++では"悪い"とされている実装です。

また、以下のようなメンバ関数を準備して必要最低限のデータには容易にアクセスできるようにしています。

public:
  // Full simulation
  const std::vector & GetMuonList() const { return MuonList; }
  const std::vector & GetElecList() const { return ElecList; }
  const std::vector & GetGammaList() const { return GammaList; }
  const std::vector & GetJetList() const { return JetList; }
  const std::vector & GetTrkList() const { return TrkList; }
  const std::vector & GetGenList() const { return GenList; }
  const std::vector & GetCellList() const { return CellList; }

  std::vector & GetMuonList() { return MuonList; }
  std::vector & GetElecList() { return ElecList; }
  std::vector & GetGammaList() { return GammaList; }
  std::vector & GetJetList() { return JetList; }
  std::vector & GetTrkList() { return TrkList; }
  std::vector & GetGenList() { return GenList; }
  std::vector & GetCellList() { return CellList; }

  double GetMissPx() const { return missPx; }
  double GetMissPy() const { return missPy; }

  // Fast simulation
  const std::vector & GetMuonListAtlfast() const { return MuonListAtlfast; }
  const std::vector & GetElecListAtlfast() const { return ElecListAtlfast; }
  const std::vector & GetGammaListAtlfast() const { return GammaListAtlfast; }
  const std::vector & GetJetListAtlfast() const { return JetListAtlfast; }
  const std::vector & GetJetBListAtlfast() const { return JetBListAtlfast; }
  const std::vector & GetTrkListAtlfast() const { return TrkListAtlfast; }
  const std::vector & GetGenListAtlfast() const { return GenListAtlfast; }
  const std::vector & GetCellListAtlfast() const { return CellListAtlfast; }

  std::vector & GetMuonListAtlfast() { return MuonListAtlfast; }
  std::vector & GetElecListAtlfast() { return ElecListAtlfast; }
  std::vector & GetGammaListAtlfast() { return GammaListAtlfast; }
  std::vector & GetJetListAtlfast() { return JetListAtlfast; }
  std::vector & GetJetBListAtlfast() { return JetBListAtlfast; }
  std::vector & GetTrkListAtlfast() { return TrkListAtlfast; }
  std::vector & GetGenListAtlfast() { return GenListAtlfast; }
  std::vector & GetCellListAtlfast() { return CellListAtlfast; }

  double GetMissPxAtlfast() const { return missPxAtlfast; }
  double GetMissPyAtlfast() const { return missPyAtlfast; }

  int GetRunNumber() const { return indexRun; }
  int GetEventNumber() const { return indexEvent; }
  double GetEventWeight() const { return eventWeight; }
  int IsMC() const { return isMCFlag; } // Real Data or MC Data?
  int GetModeMC() const { return modeMC; } // Fast or Full etc?
  int IsDebug() const { return debugFlag; } // Debug mode? 基本的にcout等でメッセージを出す。
  int IsSkim() const { return doSkim; } // 保存したいイベントかどうか?
  void SetDebug(int f) { debugFlag = f; }
  void SetSkim(int f) { doSkim = f; }
  void SetCellJetEventDisplay(int f=1) { doCellJetEventDisplay = f; } // Event Display 1
  void SetMultiObjEventDisplay(int f=1) { doMultiObjEventDisplay = f; } // Event Display 2
  void DumpListSize() const; // Dump size of lists
  int IsInputDataUnitMeV() const { return m_isInputDataUnitMeV; } // Unit情報
前節ZZ.cxxの説明に
  // Which data are used?
  // 必要なデータだけをロードするためのおまじない。
  // ここでは、Atlfast関係のデータだけをロードするようにした。
  DeactivateAll();
  ActivateAtlfast();
という行がありました。
コメントにあるように、おまじないと言ってごまかしましたが、ROOTでは重要です。
ROOTファイルの全データにアクセスできる状態にしておくと正直言って遅いです。
CBNTにはたくさんのパラメータ(order 1000)が保存されているため
すべてをメモリー上にロードするのに時間がかかるからです。
そのため、アクセスするデータだけロードする必要があります。
これは将来改善されるらしい(MLでの話)ですが、現状ではユーザーがどうにかしなければなりません。
Full simulation用にいくつかのActivateXXXとDeactivateXXXメンバ関数が用意されています。
詳しくはヘッダーファイルかそれに該当するコードを見てください。
例えば、
ActivateAtlfast()   --> ロードする。
DeactivateAtlfast() --> ロードしない。
というメンバ関数が準備されています。

更に、個別にロードしたい場合は
ActivateInfo("Run")   --> Runをロードする。
DeactivateInfo("Run") --> Runをロードしない。
のようにします。つまり、ActivateInfo(const std::string&)等のメンバ関数もあります。

Go to the next page
Go to the previous page

Go to the index page

jtanaka