示例#1
0
/// Export MC Anchor Guess + derived information in JSON format
/// To be used for the web browsing
void ExportMCAnchorJSON(){
  AliExternalInfo info;
  TTree*tree = info.GetTreeMCPassGuess();
  tree->SetAlias("MCProdNameA","MCProdName.fString");
  tree->SetAlias("MCAliphysicsA","MCAliphysics.fString");
  tree->SetAlias("MCAlirootA","MCAliroot.fString");
  tree->SetAlias("AnchorProdTagA","AnchorProdTag.fString");
  tree->SetAlias("AnchorPassNameA","AnchorPassName.fString");
  tree->SetAlias("AnchorAliphysicsA","Anchoraliphys.fString");
  tree->SetAlias("AnchorAlirootA","Anchoraliroot.fString");

  TString toExport="";
  toExport+="MCProdNameA:MCAliphysicsA:MCAlirootA:";
  toExport+="AnchorProdTagA:AnchorPassNameA:AnchorAlirootA:AnchorAliphysicsA:";
  toExport+="rankGuess:runNMatches:runNMC:runNAnchor";
  AliTreePlayer::selectWhatWhereOrderBy(tree,toExport,"","",0,100000,"json","MCAnchor.json");
  // to test output - print using jq
  // cat MCAnchor.json  | jq .tree[0,1]    # print first selected entries
  // cat MCAnchor.json  | jq -c '.tree[] | select(.AnchorProdTagA | contains("LHC15o"))'| jq    #print selected entries anchored to LHC15o
  // cat MCAnchor.json  | jq -c '.tree[] | select(.AnchorProdTagA | contains("LHC15o"))'| jq .MCProdNameA  # print prod name for selected entries anchored to LHC15o

}
示例#2
0
/// Cache MC production information
/// TODO - reset cache timeout before
void CacheMCProductionInfo(){
  AliExternalInfo info;
  TTree *tree = info.GetTreeMCPassGuess();
  delete tree;
}