--- chewbacca/event/PamelaRun.cpp 2008/09/23 07:19:55 1.1.1.1 +++ chewbacca/event/PamelaRun.cpp 2009/07/29 15:47:23 1.4 @@ -1,7 +1,7 @@ /** @file - * $Author: messineo $ - * $Date: 2008-03-11 14:26:19 $ - * $Revision: 1.4 $ + * $Author: mocchiut $ + * $Date: 2009/07/24 13:53:51 $ + * $Revision: 1.3 $ * * Implementation of the PamelaRun class. */ @@ -51,9 +51,9 @@ Path(path), Run(fileName), RunNumber(1),//veirificare se รจ possibilie eliminare questa variabile + compression(compr), Multiple(multiple), - SingleFile(0), - compression(compr){ + SingleFile(0){ RunExists(fileName); info = RunInfoYoda(this); @@ -78,8 +78,8 @@ * @return int */ void PamelaRun::RunExists(std::string input) throw (std::exception){ - int res; - DIR *dirp; + // int res; + // DIR *dirp; std::string fileName; //std::string pathDir((char*)getenv("YODA_DATA")); std::string pathDir(GetPath()); @@ -316,7 +316,8 @@ SubPacket *packet = *(SubPacket**)subpacket; // look into the map of subpackets if we already read it. - std::string FullName = packet->GetPacketType()->GetName() + "." + name; + // std::string FullName = packet->GetPacketType()->GetName() + "." + name; + std::string FullName = (const std::string)packet->GetPacketType()->GetName() + "." + name; SubPacketMap::iterator i = SubPacketAddresses.find(FullName); if (i != SubPacketAddresses.end()) { // it is in the map *(SubPacket**)subpacket = i->second; @@ -389,7 +390,8 @@ FileName = GetFileName(packet, name); CreateDirectoryStructure(FileName.c_str()); File = new TFile(FileName.c_str(), "create"); - tree = new TTree(TreeName.c_str(), algo->GetAlgorithmName().c_str()); + // tree = new TTree(TreeName.c_str(), algo->GetAlgorithmName().c_str()); + tree = new TTree(TreeName.c_str(), algo->GetAlgorithmName()); WritingRootTrees[packet->GetPacketType()].push_back(tree); File->SetCompressionLevel(compression); @@ -419,7 +421,8 @@ oss << "Register: " << name << " for " << algo->GetAlgorithmName() << " (writing)"; //logger->debug(oss.str().c_str()); TTree* HeaderTree = ReadTTree(packet->GetPacketType()); - std::string FullName = packet->GetPacketType()->GetName() + "." + name; + // std::string FullName = packet->GetPacketType()->GetName() + "." + name; + std::string FullName = (const std::string)packet->GetPacketType()->GetName() + "." + name; if (Multiple) { TTree* tree = CreateTTree(algo, packet, name); oss.str(""); @@ -567,7 +570,7 @@ EventHeader header(type); std::string EventType = (&header)->GetPacketType()->GetName(); - // std::cout<SetCompressionLevel(compression); - tree = new TTree("Pscu", algo->GetAlgorithmName().c_str()); + // tree = new TTree("Pscu", algo->GetAlgorithmName().c_str()); + tree = new TTree("Pscu", algo->GetAlgorithmName()); WritingRootTrees[(&header)->GetPacketType()].push_back(tree); tree->GetCurrentFile()->cd(); tree->Branch(GetDefaultBranchName(&header).c_str(), @@ -589,15 +593,17 @@ } else { if (!Multiple && (SingleFile == NULL)){ //std::string pathDir((char*)getenv("YODA_DATA")); - SingleFile = new TFile((GetPath() + "/" + Run + ".root").c_str(), "update"); + SingleFile = new TFile((GetPath() + "/" + Run + ".root").c_str(), "update"); SingleFile->SetCompressionLevel(compression); } - tree = new TTree(EventType.c_str(), algo->GetAlgorithmName().c_str()); + // tree = new TTree(EventType.c_str(), algo->GetAlgorithmName().c_str()); + tree = new TTree(EventType.c_str(), algo->GetAlgorithmName()); WritingRootTrees[type].push_back(tree); tree->GetCurrentFile()->cd(); - tree->Branch(GetDefaultBranchName(&header).c_str(), + tree->Branch(GetDefaultBranchName(&header).c_str(), (*subpacket)->Class()->GetName(), subpacket); + TTreeMap.insert(RootTreeMap::value_type(type, tree)); }