text
stringlengths
8
6.88M
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #include "modules/database/src/opdatabase_base.h" #if defined DATABASE_MODULE_MANAGER_SUPPORT || defined OPSTORAGE_SUPPORT #include "modules/database/database_module.h" #include "modules/url/url_lop_api.h" #ifdef DATABASE_MODULE_MANAGER_SUPPORT # include "modules/database/opdatabasemanager.h" # include "modules/database/sec_policy.h" # include "modules/database/ps_commander.h" # include "modules/about/operawebstorage.h" #endif //DATABASE_MODULE_MANAGER_SUPPORT #ifdef OPSTORAGE_SUPPORT # include "modules/database/opstorage.h" #endif //OPSTORAGE_SUPPORT #ifdef HAS_OPERA_WEBSTORAGE_PAGE class OperaWebStorageAdminURLGenerator : public OperaURL_Generator { OperaWebStorage::PageType m_type; public: OperaWebStorageAdminURLGenerator(OperaWebStorage::PageType type) : m_type(type) {} virtual ~OperaWebStorageAdminURLGenerator() {} virtual GeneratorMode GetMode() const { return KQuickGenerate; } virtual OP_STATUS QuickGenerate(URL &url, OpWindowCommander*) { g_url_api->MakeUnique(url); OperaWebStorage page(url, m_type); return page.GenerateData(); } static OP_STATUS Create(OperaWebStorage::PageType type, const OpStringC8 &p_name, BOOL prefix, OperaWebStorageAdminURLGenerator ** result) { OP_ASSERT(result != NULL); OperaWebStorageAdminURLGenerator* o = OP_NEW(OperaWebStorageAdminURLGenerator, (type)); RETURN_OOM_IF_NULL(o); OP_STATUS status = o->Construct(p_name, prefix); if (OpStatus::IsError(status)) OP_DELETE(o); else *result = o; return status; } }; #endif // HAS_OPERA_WEBSTORAGE_PAGE DatabaseModule::DatabaseModule() : m_being_destroyed(FALSE) { #ifdef DATABASE_MODULE_MANAGER_SUPPORT m_ps_manager_instance = NULL; m_ps_commander = NULL; m_policy_globals = NULL; # ifdef DATABASE_ABOUT_WEBDATABASES_URL m_webdatabase_admin_generator = NULL; # endif //DATABASE_ABOUT_WEBDATABASES_URL #endif //DATABASE_MODULE_MANAGER_SUPPORT #ifdef OPSTORAGE_SUPPORT m_web_storage_mgr_instance = NULL; m_opstorage_globals = NULL; # ifdef DATABASE_ABOUT_WEBSTORAGE_URL m_webstorage_admin_generator = NULL; # endif // DATABASE_ABOUT_WEBSTORAGE_URL #endif //OPSTORAGE_SUPPORT } void DatabaseModule::InitL(const OperaInitInfo& info) { OP_STATUS status = Init(info); if (OpStatus::IsError(status)) { Destroy(); LEAVE(status); } } OP_STATUS DatabaseModule::Init(const OperaInitInfo& info) { #ifdef DATABASE_MODULE_MANAGER_SUPPORT OP_ASSERT(m_policy_globals == NULL); m_policy_globals = OP_NEW(PS_PolicyFactory,()); RETURN_OOM_IF_NULL(m_policy_globals); OP_ASSERT(m_ps_manager_instance == NULL); m_ps_manager_instance = OP_NEW(PS_Manager,()); RETURN_OOM_IF_NULL(m_ps_manager_instance); OP_ASSERT(m_ps_commander == NULL); m_ps_commander = OP_NEW(PersistentStorageCommander,()); RETURN_OOM_IF_NULL(m_ps_commander); # if defined DATABASE_ABOUT_WEBDATABASES_URL && defined HAS_OPERA_WEBSTORAGE_PAGE OP_ASSERT(m_webdatabase_admin_generator == NULL); RETURN_IF_ERROR(OperaWebStorageAdminURLGenerator::Create(OperaWebStorage::WEB_DATABASES, DATABASE_ABOUT_WEBDATABASES_URL, FALSE, &m_webdatabase_admin_generator)); OP_ASSERT(m_webdatabase_admin_generator != NULL); g_url_api->RegisterOperaURL(m_webdatabase_admin_generator); # endif // defined DATABASE_ABOUT_WEBDATABASES_URL && defined HAS_OPERA_WEBSTORAGE_PAGE #endif //DATABASE_MODULE_MANAGER_SUPPORT #ifdef OPSTORAGE_SUPPORT OP_ASSERT(m_web_storage_mgr_instance == NULL); m_web_storage_mgr_instance = OpStorageManager::Create(); RETURN_OOM_IF_NULL(m_web_storage_mgr_instance); OP_ASSERT(m_opstorage_globals == NULL); m_opstorage_globals = OP_NEW(OpStorageGlobals,()); RETURN_OOM_IF_NULL(m_opstorage_globals); # if defined DATABASE_ABOUT_WEBSTORAGE_URL && defined HAS_OPERA_WEBSTORAGE_PAGE OP_ASSERT(m_webstorage_admin_generator == NULL); RETURN_IF_ERROR(OperaWebStorageAdminURLGenerator::Create(OperaWebStorage::WEB_STORAGE, DATABASE_ABOUT_WEBSTORAGE_URL, FALSE, &m_webstorage_admin_generator)); OP_ASSERT(m_webstorage_admin_generator != NULL); g_url_api->RegisterOperaURL(m_webstorage_admin_generator); # endif // defined DATABASE_ABOUT_WEBSTORAGE_URL && defined HAS_OPERA_WEBSTORAGE_PAGE #endif //OPSTORAGE_SUPPORT return OpStatus::OK; } #ifdef DEBUG_ENABLE_OPASSERT DatabaseModule::~DatabaseModule() { #ifdef DATABASE_MODULE_MANAGER_SUPPORT OP_ASSERT(m_policy_globals == NULL); OP_ASSERT(m_ps_manager_instance == NULL); OP_ASSERT(m_ps_commander == NULL); # ifdef DATABASE_ABOUT_WEBDATABASES_URL OP_ASSERT(m_webdatabase_admin_generator == NULL); # endif // DATABASE_ABOUT_WEBDATABASES_URL #endif // DATABASE_MODULE_MANAGER_SUPPORT #ifdef OPSTORAGE_SUPPORT OP_ASSERT(m_web_storage_mgr_instance == NULL); OP_ASSERT(m_opstorage_globals == NULL); # ifdef DATABASE_ABOUT_WEBSTORAGE_URL OP_ASSERT(m_webstorage_admin_generator == NULL); # endif // DATABASE_ABOUT_WEBSTORAGE_URL #endif // OPSTORAGE_SUPPORT } #endif // DEBUG_ENABLE_OPASSERT void DatabaseModule::Destroy() { m_being_destroyed = TRUE; #ifdef OPSTORAGE_SUPPORT # ifdef DATABASE_ABOUT_WEBSTORAGE_URL OP_DELETE(m_webstorage_admin_generator); m_webstorage_admin_generator = NULL; # endif // defined DATABASE_ABOUT_WEBSTORAGE_URL && defined DATABASE_MODULE_MANAGER_SUPPORT OP_ASSERT(m_web_storage_mgr_instance->GetRefCount() == 1); m_web_storage_mgr_instance->Release(); m_web_storage_mgr_instance = NULL; OP_DELETE(m_opstorage_globals); m_opstorage_globals = NULL; #endif //OPSTORAGE_SUPPORT #ifdef DATABASE_MODULE_MANAGER_SUPPORT # ifdef DATABASE_ABOUT_WEBDATABASES_URL OP_DELETE(m_webdatabase_admin_generator); m_webdatabase_admin_generator = NULL; # endif // DATABASE_ABOUT_WEBDATABASES_URL OP_DELETE(m_ps_commander); m_ps_commander = NULL; if (m_ps_manager_instance != NULL) { OP_DELETE(m_ps_manager_instance); m_ps_manager_instance = NULL; } OP_DELETE(m_policy_globals); m_policy_globals = NULL; #endif //DATABASE_MODULE_MANAGER_SUPPORT } #endif //defined DATABASE_MODULE_MANAGER_SUPPORT || defined OPSTORAGE_SUPPORT
#pragma once #include <Component.h> #include <array> namespace breakout { class MovementComponent : public BaseComponent { public: static EComponentType GetType() { return EComponentType::Movement; }; MovementComponent(); ~MovementComponent(); const std::array<float, 2>& GetVelocity() const; void SetVelocity(const std::array<float, 2>& velocity); private: std::array<float, 2> m_velocity = { 1.f, 1.f }; }; }
#include <iostream> #include <algorithm> using namespace std; int main(void) { int time[1001] = { 0 }; int n; int result = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> time[i]; } sort(time+1, time + n +1); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { result += time[j]; } } cout << result; return 0; }
#ifndef LIGHTIMAGE_POINT_H #define LIGHTIMAGE_POINT_H namespace li { template<typename _Tp> class Point2_ { public: Point2_(_Tp _x, _Tp _y); Point2_(const li::Point2_<_Tp> &p); Point2_(); const Point2_ operator+(const Point2_ &p); const Point2_ operator-(const Point2_ &p); Point2_ &operator=(const Point2_ p); _Tp x, y; }; template<typename _Tp> class Point3_ { public: Point3_(_Tp _x, _Tp _y, _Tp _z); Point3_(const li::Point3_<_Tp> &p); Point3_(); const Point3_ operator+(const Point3_ &p); const Point3_ operator-(const Point3_ &p); Point3_ &operator=(const Point3_ &p); _Tp x, y, z; }; template<typename _Tp> Point2_<_Tp>::Point2_(_Tp _x, _Tp _y) : x(_x), y(_y) { } template<typename _Tp> Point2_<_Tp>::Point2_(const li::Point2_<_Tp> &p) { x = p.x; y = p.y; } template<typename _Tp> Point2_<_Tp>::Point2_() : x(0), y(0) { } template<typename _Tp> const Point2_<_Tp> Point2_<_Tp>::operator+(const li::Point2_<_Tp> &p) { return Point2_<_Tp>(x + p.x, y + p.y); } template<typename _Tp> const Point2_<_Tp> Point2_<_Tp>::operator-(const li::Point2_<_Tp> &p) { return Point2_<_Tp>(x + p.x, y + p.y); } template<typename _Tp> Point2_<_Tp> &Point2_<_Tp>::operator=(const li::Point2_<_Tp> p) { x = p.x; y = p.y; return *this; } template<typename _Tp> Point3_<_Tp>::Point3_() : x(0), y(0), z(0) { } template<typename _Tp> Point3_<_Tp>::Point3_(_Tp _x, _Tp _y, _Tp _z) : x(_x), y(_y), z(_z) { } template<typename _Tp> Point3_<_Tp>::Point3_(const li::Point3_<_Tp> &p) { x = p.x; y = p.y; z = p.z; } template<typename _Tp> const Point3_<_Tp> Point3_<_Tp>::operator+(const li::Point3_<_Tp> &p) { return Point3_<_Tp>(x + p.x, y + p.y, z + p.z); } template<typename _Tp> const Point3_<_Tp> Point3_<_Tp>::operator-(const li::Point3_<_Tp> &p) { return Point3_<_Tp>(x - p.x, y - p.y, z + p.z); } template<typename _Tp> Point3_<_Tp> &Point3_<_Tp>::operator=(const li::Point3_<_Tp> &p) { x = p.x; y = p.y; z = p.z; return *this; } } #endif //LIGHTIMAGE_POINT_H
#pragma once class GameCursor; class AIEditNodeButton; class AIEditNode; class AIEditNodeTechnique; class AIEditNodeProcess; class AIEditNodeSelectFonts; class AIEditNodeTarget : public GameObject { public: ~AIEditNodeTarget(); bool Start(); void Update(); void Num(); void Technique(); void FontsConfirmation(); enum target { enme = 100, enbaddy, enenemy, ennull = 0, }; int GetTarget() { return m_target; } bool Getfonttarget() { return fonttarget; } private: target m_target = ennull; int button = 3; bool Choice0 = false; bool fonttarget = false; bool fonts = false; bool contact1 = false; bool contact2 = false; CVector2 SetShadowPos = { 5.f,-5.f }; //文字の影の座標。 CVector3 m_position = CVector3::Zero(); CVector3 cursorpos = CVector3::Zero(); std::vector<FontRender*> m_fonts; std::vector<FontRender*> m_font; std::vector<AIEditNodeButton*> m_nodebuttons; SpriteRender* m_spriteRender = nullptr; FontRender* m_fontRender = nullptr; AIEditNodeButton* m_aieditnodebutton = nullptr; GameCursor * m_gamecursor = nullptr; AIEditNode* m_aieditnode = nullptr; AIEditNodeTechnique* m_aieditnodetechique = nullptr; AIEditNodeProcess* m_aieditnodeprocess = nullptr; AIEditNodeSelectFonts* m_aieditnodeselectfonts = nullptr; };
#ifdef __BUILDING_THE_DLL #define __EXPORT_TYPE __export #else #define __EXPORT_TYPE __import #endif #ifndef _MYDLL_H #define _MYDLL_H typedef struct _dllversioninfo { DWORD dwmajorversion; DWORD dwminorversion; DWORD dwbuildnumber; DWORD dwplatformid; }dllversioninfo; typedef LONG HRESULT; typedef bool(WINAPI * pSnmpExtensionInit) ( IN DWORD dwTimeZeroReference, OUT HANDLE * hPollForTrapEvent, OUT AsnObjectIdentifier * supportedView); typedef bool(WINAPI * pSnmpExtensionTrap) ( OUT AsnObjectIdentifier * enterprise, OUT AsnInteger * genericTrap, OUT AsnInteger * specificTrap, OUT AsnTimeticks * timeStamp, OUT RFC1157VarBindList * variableBindings); typedef bool(WINAPI * pSnmpExtensionQuery) ( IN BYTE requestType, IN OUT RFC1157VarBindList * variableBindings, OUT AsnInteger * errorStatus, OUT AsnInteger * errorIndex); typedef bool(WINAPI * pSnmpExtensionInitEx) ( OUT AsnObjectIdentifier * supportedView); extern "C" void __declspec(dllexport) WINAPI YourFunctionNumberOne(); extern "C" HRESULT __declspec(dllexport) WINAPI DllGetVersion(dllversioninfo* Release); class __declspec(dllexport) Computer { private: AnsiString Server; AnsiString Domain; TMemo *Report; public: Computer(); Computer(AnsiString newServer, TMemo *newReport); Computer(AnsiString newServer, AnsiString newDomain, TMemo *newReport); // ~Computer(); bool EnumDrives(); bool EnumServerDisks(); bool EnumUsers(); bool EnumGroups(); bool EnumServers(); bool GetDCName(); bool EnumNetHandler(DWORD dwLevel, LPNETRESOURCE lpNet, TMemo* Report); bool GetMACAdapters(int nGetWay); }; #endif
#include <iostream> #include <windows.h> #include <algorithm> using namespace std; #define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0) //必要的,我是背下来的 int getPixel(){ HDC hDC = ::GetDC(NULL); //获取屏幕DC POINT pt; GetCursorPos(&pt); COLORREF clr = ::GetPixel(hDC,pt.x,pt.y); int res = clr; ::ReleaseDC(NULL, hDC); return clr; } void enter(int KeyCode){ keybd_event(KeyCode, 0, 0, 0); keybd_event(KeyCode, 0, KEYEVENTF_KEYUP, 0); Sleep(300); } void showupWindowAndFull(string software){ if(software == "wechat") { // ctrl + alt + w -> show the window keybd_event(VK_CONTROL,(BYTE)0,0,0); keybd_event(VK_MENU,(BYTE)0,0,0); keybd_event(0x57,(BYTE)0,0,0); keybd_event(VK_CONTROL,(BYTE)0,KEYEVENTF_KEYUP,0); keybd_event(VK_MENU,(BYTE)0,KEYEVENTF_KEYUP,0); keybd_event(0x57,(BYTE)0,KEYEVENTF_KEYUP,0); Sleep(500); // full screen keybd_event(VK_LWIN,(BYTE)0,0,0); keybd_event(VK_UP,(BYTE)0,0,0); keybd_event(VK_UP,(BYTE)0,KEYEVENTF_KEYUP,0); keybd_event(VK_LWIN,(BYTE)0,KEYEVENTF_KEYUP,0); } } void moveCursor(int pointX,int pointY){ SetCursorPos(pointX,pointY);//更改鼠标坐标 } void clickLeftMouse(){ mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP,0, 0, 0, 0); } void gtSeachAndInput(int pointX,int pointY,string key){ SetCursorPos(pointX,pointY);//更改鼠标坐标 //mouse left key down and up mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP,0, 0, 0, 0); Sleep(500); transform(key.begin(), key.end(), key.begin(), ::toupper); for(int i = 0; i < key.length(); i++){ enter(key[i]); } Sleep(500); enter(VK_RETURN); } void getSit(){ //click "zuowei" moveCursor(599,804); Sleep(500); clickLeftMouse(); //get the sit; //370 758 Sleep(1000); moveCursor(647, 563); clickLeftMouse(); Sleep(100); clickLeftMouse(); Sleep(100); clickLeftMouse(); Sleep(100); Sleep(500); moveCursor(886, 567); clickLeftMouse(); Sleep(100); clickLeftMouse(); Sleep(100); clickLeftMouse(); Sleep(100); } void detectMousPosition(){ while(true){ cout<<"Working"<<endl; if(KEY_DOWN(VK_LBUTTON)){ POINT p; GetCursorPos(&p); cout<<p.x<<" "<<p.y<<endl; } if(KEY_DOWN(0x51)){ break; } Sleep(500); } } int main() { showupWindowAndFull("wechat"); gtSeachAndInput(117,30,"wqtsg"); getSit(); // 370 758 // detectMousPosition(); // ::ReleaseDC(NULL, hDC); //释放屏幕DC return 0; }
// // Utils.cpp // RSA // // Created by ivan sarno on 21/08/15. // Copyright (c) 2015 ivan sarno /* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ //Version V.4.1 #include "Utils.h" using namespace RSA; using namespace Utils; //random number generator, only for test Utils::TestGenerator::TestGenerator() { mpz_init(rand); std::random_device rd; seed = rd(); gmp_randinit_mt(rstate); gmp_randseed_ui(rstate, seed); } //random number generator, only for test Utils::TestGenerator::TestGenerator(unsigned long long seed) { mpz_init(rand); this->seed = seed; gmp_randinit_mt(rstate); gmp_randseed_ui(rstate, this->seed); } Utils::TestGenerator::~TestGenerator() { mpz_clear(rand); gmp_randclear(rstate); } BigInteger Utils::TestGenerator::getBig(unsigned int size) { mpz_urandomb(rand, rstate, size); return BigInteger(rand); }; unsigned long long Utils::TestGenerator::getInt() { BigInteger temp = this->getBig(64); return temp.get_si(); } BigInteger Utils::pow(BigInteger base, BigInteger exp) { BigInteger resoult = 1; while(exp > 0) { if(BigInteger(exp & 1) == 1) resoult *= base; base *= base; exp >>=1; } return resoult; } BigInteger Utils::mod_pow(BigInteger base, BigInteger exp, const BigInteger &mod) { BigInteger resoult = 1; while(exp > 0) { if(BigInteger(exp & 1) == 1) resoult = (base * resoult) % mod; base = (base * base) % mod; exp >>=1; } return resoult; } BigInteger Utils::inverse(const BigInteger &number, const BigInteger &modulus, unsigned int size) { if (modulus == 0) { return 0; } int j = 1; BigInteger result, temp, intermediate; BigInteger *buffer = new BigInteger[size+3]; buffer[0] = number; buffer[1] = modulus; while(buffer[j] != 0) //find intermediate values of greatest common divisor { j++; buffer[j] = buffer[j-2] % buffer[j-1]; } result = 1; intermediate = 1; temp = 0; while(j > 1) //inverse calculation from intermediates values { j--; result = temp; temp = intermediate - ((buffer[j-1] / buffer[j]) * temp); intermediate = result; } delete [] buffer; if(result > 0) return result; else return modulus + result; } bool Utils::coprime (BigInteger a, BigInteger b) { if (b == 0) return false; BigInteger temp; long i = 0; while(b > 0) //find greatest common divisor { i++; temp = b; b = a % b; a = temp; } return a == 1; } BigInteger Utils::byte2biginteger(uint8_t *byte, unsigned int size) { mpz_t z; mpz_init(z); mpz_import(z, size, 1, sizeof(byte[0]), 0, 0, byte); BigInteger r = BigInteger(z); mpz_clear(z); return r; } unsigned Utils::bitSize(const BigInteger &number) { return static_cast<unsigned int>(mpz_sizeinbase(number.get_mpz_t(), 2)); }
#include "_pch.h" #include "RecentDstOidModel.h" using namespace wh; //----------------------------------------------------------------------------- RecentDstOidModel::RecentDstOidModel(std::size_t max_items) :mMaxItems(max_items) { } //----------------------------------------------------------------------------- void RecentDstOidModel::Clear(std::size_t max_items) { mMruList.clear(); mMaxItems = max_items; DoSigUpdate(); } //----------------------------------------------------------------------------- bool RecentDstOidModel::Check(const wxString& item)const { const auto& uniqueIdx = mMruList.get<1>(); return (uniqueIdx.end() != uniqueIdx.find(item)); } //----------------------------------------------------------------------------- void RecentDstOidModel::InsertWithoutSig(const wxString& item) { std::pair<rec::MruList::iterator, bool> p = mMruList.push_front(item); if (!p.second){ /* duplicate item */ mMruList.relocate(mMruList.begin(), p.first); /* put in front */ } else if (mMruList.size()>mMaxItems){ /* keep the length <= max_num_items */ mMruList.pop_back(); } } //----------------------------------------------------------------------------- void RecentDstOidModel::Insert(const wxString& item) { InsertWithoutSig(item); DoSigUpdate(); } //----------------------------------------------------------------------------- void RecentDstOidModel::Load(const boost::property_tree::wptree& app_cfg) { TEST_FUNC_TIME; using ptree = boost::property_tree::wptree; Clear(); ptree::const_assoc_iterator it = app_cfg.find(L"RecentDstOid"); if (it != app_cfg.not_found()) { mFilterEnable = it->second.get<int>(L"FilterEnable", 1); mRecentEnable = it->second.get<int>(L"RecentEnable", 1); mMaxItems = it->second.get<int>(L"MaxQty", 10); for (const ptree::value_type &v : it->second.get_child(L"Oid")) { wxString str = v.second.get_value<std::wstring>(); InsertWithoutSig(str); } } DoSigUpdate(); } //----------------------------------------------------------------------------- void RecentDstOidModel::Save(boost::property_tree::wptree& app_cfg)const { TEST_FUNC_TIME; using ptree = boost::property_tree::wptree; ptree recent; recent.put(L"MaxQty", mMaxItems); recent.put(L"FilterEnable", (int)mFilterEnable); recent.put(L"RecentEnable", (int)mRecentEnable); ptree recent_dst_oid; ptree recent_oid; for (const auto& item : mMruList) { std::wstring str = item.wc_str(); recent_dst_oid.push_back(ptree::value_type(L"", ptree(str))); } //recent_oid.put_value("11"); recent_dst_oid.push_back(std::make_pair("", recent_oid)); //recent_dst_oid.push_back(ptree::value_type("", ptree("22"))); //recent_dst_oid.push_back(ptree::value_type("", ptree("33"))); recent.add_child(L"Oid", recent_dst_oid); app_cfg.add_child(L"RecentDstOid", recent); }
// // main.cpp // Pila // // Created by Daniel on 09/10/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #include <iostream> #include "Pila.h" int main(int argc, const char * argv[]) { Pila<int> * pila = new Pila<int>(); pila->push(1); pila->push(2); std::cout<< "tamano de la pila: " << pila->size() <<std::endl; return 0; }
/** * @file RunActionMessenger.cc * * @date 31 Mar 2011 * @author Pico * * @brief Physics list: particle definitions and processes. */ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "RunActionMessenger.hh" #include "RunAction.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithADoubleAndUnit.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithABool.hh" #include "G4RunManager.hh" #include "G4DigiManager.hh" #include "SteppingAction.hh" #include "PrimaryGeneratorAction.hh" #include "MyDigitizer.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... RunActionMessenger::RunActionMessenger(RunAction* RunAct) :runAct(RunAct) { runActDir = new G4UIdirectory("/GFNUNDetectors/run/"); runActDir->SetGuidance("Run Action control."); stepVerboseCmd = new G4UIcmdWithABool("/GFNUNDetectors/run/stepVerbose",this); stepVerboseCmd->SetGuidance("Select whether the SteppingAction gets verbose 'Pico Style'"); stepVerboseCmd->SetParameterName("stepVerbose_flag",true); stepVerboseCmd->SetDefaultValue(false); stepVerboseCmd->AvailableForStates(G4State_Idle,G4State_PreInit); rootNameCmd = new G4UIcmdWithAString("/GFNUNDetectors/run/ROOTfilename",this); rootNameCmd->SetGuidance("Select ROOT outputfile name."); rootNameCmd->SetParameterName("ROOT filename",true); rootNameCmd->AvailableForStates(G4State_Idle,G4State_PreInit); asciiCmd = new G4UIcmdWithABool("/GFNUNDetectors/run/ASCIIoutput",this); asciiCmd->SetGuidance("Select whether the output will also be written in ASCII"); asciiCmd->SetParameterName("ascii_flag",true); asciiCmd->SetDefaultValue(false); asciiCmd->AvailableForStates(G4State_Idle,G4State_PreInit); /** Fussy **/ /** Default: false **/ interactionCmd = new G4UIcmdWithABool("/GFNUNDetectors/run/fussy",this); interactionCmd->SetGuidance("Select whether to save the information about the number of Compton interactions"); interactionCmd->SetParameterName("fussy",true); interactionCmd->AvailableForStates(G4State_Idle,G4State_PreInit); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... RunActionMessenger::~RunActionMessenger() { delete runActDir; delete stepVerboseCmd; delete rootNameCmd; delete interactionCmd; delete asciiCmd; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void RunActionMessenger::SetNewValue(G4UIcommand* command, G4String newValue) { if( command == rootNameCmd ) runAct->SetRunName(newValue); if( command == asciiCmd ) { G4bool flag = asciiCmd->GetNewBoolValue(newValue); runAct->SetAsciiOutput(flag); } if( command == stepVerboseCmd ) { G4bool flag = stepVerboseCmd->GetNewBoolValue(newValue); G4RunManager* runManager = G4RunManager::GetRunManager(); SteppingAction* stepping = (SteppingAction*)(runManager->GetUserSteppingAction()); stepping->SetVerbose_flag(flag); } if(command == interactionCmd ) { G4RunManager* runManager = G4RunManager::GetRunManager(); SteppingAction* stepping = (SteppingAction*)(runManager->GetUserSteppingAction()); stepping->SetInteraction_flag(interactionCmd->GetNewBoolValue(newValue)); } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// // SDL_windows.hh for training in /home/franco_n/tek_one/test/cpp/git/pokemon_poubelle/classes // // Made by François Clément // Login <franco_n@epitech.net> // // Started on Tue Sep 15 18:51:18 2015 François Clément // Last update Tue Sep 15 19:11:15 2015 François Clément // #ifndef SDL_WINDOWS_HH_ # define SDL_WINDOWS_HH_ #include <SDL/SDL.h> #include <iostream> class SDLwindows { public: SDLwindows() = default; ~SDLwindows() = default; SDLwindows(SDLwindows const& win) = delete; SDLwindows &operator=(SDLwindows const& win) = delete; bool createWindows(int x, int y, int bpp, int mode); bool changeName(std::string& name) { SDL_WM_SetCaption(name.c_str(), static_cast<char *>(0)); return true; }; }; #endif
#ifndef GENERIC_ENTITY_H #define GENERIC_ENTITY_H #include "EntityBase.h" #include <string> #include "Collider/Collider.h" class Mesh; class GenericEntity : public EntityBase, public Collision { public: GenericEntity() { modelMesh = nullptr; }; GenericEntity(Mesh* _modelMesh); virtual ~GenericEntity(); enum OBJECT_TYPE { NONE = 0, PLAYER, WALL, ENEMY, BOSS, ENEMY_BULLET, PLAYER_BULLET, PIT, // aren't pits like the opposite of entities, being devoid? :thinking: SPIKE, FIRE, SLOW, POISON, TELEPORTER, EXIT, }type; virtual void Update(double _dt); virtual void Render(); virtual void CollisionResponse(GenericEntity* ThatEntity); // Set the maxAABB and minAABB void SetAABB(Vector3 maxAABB, Vector3 minAABB); // Set mesh void SetMesh(Mesh* _modelMesh, OBJECT_TYPE _type = NONE); // Get mesh Mesh* GetMesh(); // Get normal Vector3 getNormal(); //set normal void setNormal(Vector3 _normal); private: Mesh* modelMesh; Vector3 normal; }; namespace Create { GenericEntity* Entity( const std::string& _meshName, const Vector3& _position, const Vector3& _scale = Vector3(1.0f, 1.0f, 1.0f), bool _collision = false); }; #endif // GENERIC_ENTITY_H
// // Created by laureano on 11/11/19. // #ifndef AEDA_PROJETO_BILHETE_H #define AEDA_PROJETO_BILHETE_H #include "SalaEspetaculo.h" class Bilhete { float valor; Evento *evento; public: Bilhete() {}; float getValor() const; void setValor(float valor); const Evento &getEvento() const; void setEvento(Evento *evento); void printBilhete(); friend ostream &operator<<(ostream &out, const Bilhete &bilhete); }; #endif //AEDA_PROJETO_BILHETE_H
#pragma once #include"Product.h" class Builder{ public: Builder(); virtual ~Builder(); virtual void BuildPartA(); virtual void BuildPartB(); virtual void BuildPartC(); virtual Product* GetResult(); protected: Product* m_prod; };
#include<bits/stdc++.h> using namespace std; int main(){ int T; cin>>T; while(T--){ int l,n; cin>>l>>n; int minn=INT_MIN,maxx=INT_MIN; for(int i=0;i<n;i++){ int a; cin>>a; int ta=min(a,l-a); int tb=max(a,l-a); minn=max(minn,ta); maxx=max(maxx,tb); } cout<<minn<<" "<<maxx<<"\n"; } return 0; }
#include "stdafx.h" #include "IP.h" BOOL IP::Write(BYTE *link) { memcpy(link, &m_VersionIHL, 1); memcpy(link + 1, &m_DifferentiatedServices, 1); memcpy(link + 2, &m_Totallength, 2); memcpy(link + 4, &m_Identification, 2); memcpy(link + 6, &m_UnusedDFMFFragmentoffset, 2); memcpy(link + 8, &m_Timetolive, 1); memcpy(link + 9, &m_Protocol, 1); memcpy(link + 10, &m_Headerchecksum, 2); memcpy(link + 12, &m_Sourceaddress, 4); memcpy(link + 16, &m_Destinationaddress, 4); return TRUE; } BOOL IP::Read(BYTE *link) { memcpy(&m_VersionIHL, link, 1); memcpy(&m_DifferentiatedServices, link + 1, 1); memcpy(&m_Totallength, link + 2, 2); memcpy(&m_Identification, link + 4, 2); memcpy(&m_UnusedDFMFFragmentoffset, link + 6, 2); memcpy(&m_Timetolive, link + 8, 1); memcpy(&m_Protocol, link + 9, 1); memcpy(&m_Headerchecksum, link + 10, 2); memcpy(&m_Sourceaddress, link + 12, 4); memcpy(&m_Destinationaddress, link + 16, 4); return TRUE; } void IP::setVersionIHL(BYTE VersionIHL) { m_VersionIHL = VersionIHL; } void IP::setDifferentiatedServices(BYTE DifferentiatedServices) { m_DifferentiatedServices = DifferentiatedServices; } void IP::setTotallength(WORD Totallength) { m_Totallength = Totallength; } void IP::setIdentification(WORD Identification) { m_Identification = Identification; } void IP::setUnusedDFMFFragmentoffset(WORD UnusedDFMFFragmentoffset) { m_UnusedDFMFFragmentoffset = UnusedDFMFFragmentoffset; } void IP::setTimetolive(BYTE Timetolive) { m_Timetolive = Timetolive; } void IP::setProtocol(BYTE Protocol) { m_Protocol = Protocol; } void IP::setHeaderchecksum(WORD Headerchecksum) { m_Headerchecksum = Headerchecksum; } void IP::setSourceaddress(DWORD Sourceaddress) { m_Sourceaddress = Sourceaddress; } void IP::setDestinationaddress(DWORD Destinationaddress) { m_Destinationaddress = Destinationaddress; } BYTE IP::getVersionIHL() const { return m_VersionIHL; } BYTE IP::getDifferentiatedServices() const { return m_DifferentiatedServices; } WORD IP::getTotallength() const { return m_Totallength; } WORD IP::getIdentification() { return m_Identification; } WORD IP::getUnusedDFMFFragmentoffset() const { return m_UnusedDFMFFragmentoffset; } BYTE IP::getTimetolive() const { return m_Timetolive; } BYTE IP::getProtocol() const { return m_Protocol; } WORD IP::getHeaderchecksum() const { return m_Headerchecksum; } DWORD IP::getSourceaddress() const { return m_Sourceaddress; } DWORD IP::getDestinationaddress() const { return m_Destinationaddress; }
const int buttonPin1 = 2; const int buttonPin2 = 4; const int buttonPin3 = 7; const int buttonPin4 = 12; const int buttonPin5 = 13; const int buttonPin6 = 14; const int encoderPin_A = 8; const int encoderPin_B = 9; const int potPin = 2; //LED Pins const int LEDhighest = 3; const int LEDhigh = 5; const int LEDmid = 6; const int LEDlow = 10; const int LEDlowest = 11; //Buttons variables int buttonState1 = 0; int buttonState2 = 0; int buttonState3 = 0; int buttonState4 = 0; int buttonState5 = 0; int buttonState6 = 0; int previous1 = LOW; // the previous reading from button 1 int previous2 = LOW; // the previous reading from button 2 int previous3 = LOW; // the previous reading from button 3 int previous4 = LOW; // the previous reading from button 4 int previous5 = LOW; // the previous reading from button 5 int previous6 = LOW; // the previous reading from button 6 //Potentiometer int potVal = 0; long timeNow, timeNext = 0; //Variables used for scrolling String incomingReading; long maxScroll, scrolled, scrolledMapped, scrolledMappedInv = 0; int pinA = 0, pinB = 0; int oldPinA = 0, oldPinB = 0; int pos = 0, oldPos = 0; int turn = 0, oldTurn = 0, turnCount=0; //Variables used for debounce long time = 0; // the last time a button was pressed long debounce = 200; // the debounce time void setup() { pinMode(buttonPin1, INPUT); pinMode(buttonPin2, INPUT); pinMode(buttonPin3, INPUT); pinMode(buttonPin4, INPUT); pinMode(buttonPin5, INPUT); pinMode(buttonPin6, INPUT); pinMode(encoderPin_A, INPUT); digitalWrite(encoderPin_A, HIGH); pinMode(encoderPin_B, INPUT); digitalWrite(encoderPin_B, HIGH); pinMode(LEDlowest, OUTPUT); pinMode(LEDlow, OUTPUT); pinMode(LEDmid, OUTPUT); pinMode(LEDhigh, OUTPUT); pinMode(LEDhighest, OUTPUT); Serial.begin(57600); } void loop(){ //Buttons buttonState1 = digitalRead(buttonPin1); buttonState2 = digitalRead(buttonPin2); buttonState3 = digitalRead(buttonPin3); buttonState4 = digitalRead(buttonPin4); buttonState5 = digitalRead(buttonPin5); buttonState6 = digitalRead(buttonPin6); //Slide potentiometer potVal = analogRead(potPin); //Read variables from Processing mapped for consistency scrolledMapped = map(scrolled,0,maxScroll,0,1023); scrolledMappedInv = map(scrolledMapped,0,1023,1023,0); timeNow = millis(); //Turn what we get from Processing into a string if(Serial.available() > 0) { incomingReading = Serial.readStringUntil('\n'); } //LED control - changes depending on the scrolled value from Processing if(maxScroll > 0){ analogWrite(LEDlowest,scrolledMapped/4.02); analogWrite(LEDlow,scrolledLow()); analogWrite(LEDmid,127.5); analogWrite(LEDhigh,scrolledHigh()); analogWrite(LEDhighest,scrolledMappedInv/4); } else { analogWrite(LEDlowest,255); analogWrite(LEDlow,255); analogWrite(LEDmid,255); analogWrite(LEDhigh,255); analogWrite(LEDhighest,255); } //Button 1 //Strings used to talk with Processing through Serial - open Kappa if (buttonState1 == HIGH && previous1 == LOW && millis() - time > debounce) { Serial.println("q"); Serial.println(" "); //Clear the line so processing wont go nuts time = millis(); } previous1 = buttonState1; //Button 2 if (buttonState2 == HIGH && previous2 == LOW && millis() - time > debounce) { Serial.println("w"); Serial.println(" "); //Clear the line so processing wont go nuts time = millis(); } previous2 = buttonState2; //Button 3 if (buttonState3 == HIGH && previous3 == LOW && millis() - time > debounce) { Serial.println("e"); Serial.println(" "); //Clear the line so processing wont go nuts time = millis(); } previous3 = buttonState3; //Button 4 if (buttonState4 == HIGH && previous4 == LOW && millis() - time > debounce) { Serial.println("t"); Serial.println(" "); //Clear the line so processing wont go nuts time = millis(); } previous4 = buttonState4; //Button 5 if (buttonState5 == HIGH && previous5 == LOW && millis() - time > debounce) { Serial.println("y"); Serial.println(" "); //Clear the line so processing wont go nuts time = millis(); } previous5 = buttonState5; //Button 6 if (buttonState6 == HIGH && previous6 == LOW && millis() - time > debounce) { Serial.println("u"); Serial.println(" "); //Clear the line so processing wont go nuts time = millis(); analogWrite(LEDlowest,0); } else { analogWrite(LEDlowest,255); } previous6 = buttonState6; //Rotary encoder readEncoder(); //Slide potentiometer if(timeNow >= timeNext){ Serial.print("P"); Serial.println(potVal,DEC); timeNext = timeNow + 100; } //Scrolled reading from Processing (browser cookie) if(incomingReading.charAt(0) == 'S') { incomingReading.setCharAt(0,' '); incomingReading.trim(); scrolled = incomingReading.toInt(); } //Maxscroll reading from Processing (browser cookie) if(incomingReading.charAt(0) == 'M') { incomingReading.setCharAt(0,' '); incomingReading.trim(); maxScroll = incomingReading.toInt(); } } //Make sure that the LED doesn't reset when PWM is greater than 255 int scrolledLow() { int returnThis = 0; if(scrolledMapped/3.35 > 255) { returnThis = 255; } else { returnThis = scrolledMapped/3.35; } return returnThis; } //Make sure that the LED doesn't reset when PWM is greater than 255 (using inverted reading) int scrolledHigh() { int returnThis = 0; if(scrolledMappedInv/3.35 > 255) { returnThis = 255; } else { returnThis = scrolledMappedInv/3.35; } return returnThis; } void readEncoder() { pinA = digitalRead(encoderPin_A); pinB = digitalRead(encoderPin_B); //Wait until we read something different that before if ( pinA != oldPinA || pinB != oldPinB) { //Creates statements for all positions available with the Rotary Encoder if ( pinA == 1 && pinB == 1 ) { pos = 0; } else if ( pinA == 0 && pinB == 1 ) { pos = 1; } else if ( pinA == 0 && pinB == 0 ) { pos = 2; } else if ( pinA == 1 && pinB == 0 ) { pos = 3; } turn = pos-oldPos; //Make sure we are using absolute values if (abs(turn) != 2) { if (turn == -1 || turn == 3) { turnCount++; } else if (turn == 1 || turn == -3) { turnCount--; } } //Only print if there has been a full "tick" if (pos == 0){ if (turnCount > 0) { Serial.print("R"); Serial.println("1"); } else if (turnCount < 0) { Serial.print("R"); Serial.println("255"); }turnCount=0; } //Save values so we don't keep reading the same oldPinA = pinA; oldPinB = pinB; oldPos = pos; oldTurn = turn; } }
#include "solarsystem.h" namespace Simulation { SolarSystem::SolarSystem(int _ID) { this->ID = _ID; } SolarSystem::~SolarSystem() { for (int i = 0; i < this->world_count; i++) { delete this->worlds[i]; } } void SolarSystem::Init(glm::vec2 _position) { if (this->world_count == 0) { throw ReferencedUninitialisedValueException((char*) "Called Solar System Init before adding any worlds."); } this->position = _position; // Put planets in orbit int orbit_layer = 1; for (int i=0; i < this->world_count; i++) { orbit_layer += rand() % 5 + 2; this->worlds[i]->SetOrbit(orbit_layer, ORBIT_BASESPEED, rand()%360, &this->position); } } void SolarSystem::Update(float dt) { for (int i=0; i < this->world_count; i++) { worlds[i]->Update(dt); } } void SolarSystem::AddWorld(World* newworld) { if (this->world_count+1 > MAX_WORLDS_PER_SOLARSYSTEM) { throw ValueExceedsMaximumException((char*) "More worlds than maximum in solar system " + this->ID); } this->worlds[this->world_count] = newworld; this->world_count++; } }
// Created on: 1992-09-28 // Created by: Remi GILET // Copyright (c) 1992-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _GCE2d_MakeTranslation_HeaderFile #define _GCE2d_MakeTranslation_HeaderFile #include <Standard.hxx> #include <Standard_DefineAlloc.hxx> #include <Standard_Handle.hxx> class Geom2d_Transformation; class gp_Vec2d; class gp_Pnt2d; //! This class implements elementary construction algorithms for a //! translation in 2D space. The result is a //! Geom2d_Transformation transformation. //! A MakeTranslation object provides a framework for: //! - defining the construction of the transformation, //! - implementing the construction algorithm, and //! - consulting the result. class GCE2d_MakeTranslation { public: DEFINE_STANDARD_ALLOC //! Constructs a translation along the vector Vect. Standard_EXPORT GCE2d_MakeTranslation(const gp_Vec2d& Vect); //! Constructs a translation along the vector //! (Point1,Point2) defined from the point Point1 to the point Point2. Standard_EXPORT GCE2d_MakeTranslation(const gp_Pnt2d& Point1, const gp_Pnt2d& Point2); //! Returns the constructed transformation. Standard_EXPORT const Handle(Geom2d_Transformation)& Value() const; operator const Handle(Geom2d_Transformation)& () const { return Value(); } protected: private: Handle(Geom2d_Transformation) TheTranslation; }; #endif // _GCE2d_MakeTranslation_HeaderFile
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino //needed for library #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> //https://github.com/tzapu/WiFiManager int led1 = D1; int led2 = D2; String readString; WiFiServer server(80); void setup() { // put your setup code here, to run once: Serial.begin(115200); //WiFiManager //Local intialization. Once its business is done, there is no need to keep it around WiFiManager wifiManager; //reset saved settings wifiManager.resetSettings(); //set custom ip for portal //wifiManager.setAPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); //fetches ssid and pass from eeprom and tries to connect //if it does not connect it starts an access point with the specified name //here "AutoConnectAP" //and goes into a blocking loop awaiting configuration wifiManager.autoConnect("Sandeep"); //or use this for auto generated name ESP + ChipID //wifiManager.autoConnect(); //if you get here you have connected to the WiFi Serial.println("connected...yeey :)"); Serial.println(WiFi.localIP()); // prepare GPIO5 pinMode(D1, OUTPUT); digitalWrite(D1, 0); pinMode(D2, OUTPUT); digitalWrite(D2, 0); server.begin(); Serial.println("Server started"); // Print the IP address Serial.println(WiFi.localIP()); } void loop() { // put your main code here, to run repeatedly: // Check if a client has connected WiFiClient client = server.available(); if (client) { while (client.connected()) { if (client.available()) { char c = client.read(); //read char by char HTTP request if (readString.length() < 100) { //store characters to string readString += c; //Serial.print(c); } //if HTTP request has ended if (c == '\n') { Serial.println(readString); //print to serial monitor for debuging client.println("<head>"); client.println("<meta charset=\"utf-8\">"); client.println("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">"); client.println("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); client.println("<script src=\"https://code.jquery.com/jquery-2.1.3.min.js\"></script>"); client.println("<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">"); client.println("</head><div class=\"container\">"); client.println("<h1>Web Server</h1>"); client.println("<h2>GPIO 0</h2>"); client.println("<div class=\"row\">"); client.println("<div class=\"col-md-2\"><a href=\"?pin=ON1\" class=\"btn btn-block btn-lg btn-success\" role=\"button\">ON</a></div>"); client.println("<div class=\"col-md-2\"><a href=\"?pin=OFF1\" class=\"btn btn-block btn-lg btn-danger\" role=\"button\">OFF</a></div>"); client.println("</div>"); client.println("<h2>GPIO 2</h2>"); client.println("<div class=\"row\">"); client.println("<div class=\"col-md-2\"><a href=\"?pin=ON2\" class=\"btn btn-block btn-lg btn-primary\" role=\"button\">ON</a></div>"); client.println("<div class=\"col-md-2\"><a href=\"?pin=OFF2\" class=\"btn btn-block btn-lg btn-warning\" role=\"button\">OFF</a></div>"); client.println("</div></div>"); delay(1); //stopping client //controls the Arduino if you press the buttons if (readString.indexOf("?pin=ON1") >0){ digitalWrite(led1, HIGH); } else if (readString.indexOf("?pin=OFF1") >0){ digitalWrite(led1, LOW); } else if (readString.indexOf("?pin=ON2") >0){ digitalWrite(led2, HIGH); } else if (readString.indexOf("?pin=OFF2") >0){ digitalWrite(led2, LOW); } //clearing string for next read readString=""; } } } } delay(1); // close the connection: client.stop(); }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef OPBPATH_H #define OPBPATH_H #ifdef SVG_SUPPORT #define FLAT_SEGMENT_STORAGE #define COMPRESS_PATH_STRINGS #define KEEP_LAST_MOVETO_INDEX // Optimization for normalized pathseglists #include "modules/svg/svg_path.h" #include "modules/svg/src/SVGObject.h" #include "modules/svg/src/SVGNumberPair.h" #include "modules/svg/src/SVGRect.h" // This define enables expensive checks before and after modification // of m_segments in SynchronizedPathSegLists. The check consists of // looping through all segments and checking if the pointers and // indexes are correct. By doing this early and often, the source of // the problem can be find more easily. When disabled, it should // compile to nothing. // // In the code, the macro CHECK_SYNC calls the sync-checking function, // when enabled. #if 0 #define SVG_PATH_EXPENSIVE_SYNC_TESTS #endif // Integrate functionality of the motion path into OpBpath directly // Requirements: // - Transform () // - Support the PositionDescriptor interface (basically what // parameters animateMotion has) for getting a transform // - Calculate keyspline // - Get the (unnormalized) path segment at a certain length // - Calculate transform at path distance (for textPath) // - Calculate rotation at path distance (for textPath) // - GetLength // - Do magic warping (for textPath) class SVGCompoundSegment; class SVGPathSeg { public: union { struct { unsigned int type:5; unsigned int is_explicit:1; // To differentiate explicit moveto:s from implicit unsigned int sweep:1; unsigned int large:1; /* 8 bits */ } info; unsigned char m_seg_info_packed_init; }; SVGPathSeg() : m_seg_info_packed_init(0) { } /* => type(SVGP_UNKNOWN), is_explicit(0), sweep(0), large(0) */ void MakeExplicit() { info.is_explicit = (info.type == SVGP_MOVETO_ABS || info.type == SVGP_MOVETO_REL) ? 1 : 0; } BOOL operator==(const SVGPathSeg& other) const; /* SVGP_UNKNOWN // SVGP_CLOSE = 1, // SVGP_MOVETO_ABS = 2, // SVGP_MOVETO_REL = 3, // SVGP_LINETO_ABS = 4, // SVGP_LINETO_REL = 5, // SVGP_CURVETO_CUBIC_ABS = 6, // SVGP_CURVETO_CUBIC_REL = 7, // SVGP_CURVETO_QUADRATIC_ABS = 8, // SVGP_CURVETO_QUADRATIC_REL = 9, // SVGP_ARC_ABS = 10, // SVGP_ARC_REL = 11, // SVGP_LINETO_HORIZONTAL_ABS = 12, // SVGP_LINETO_HORIZONTAL_REL = 13, // SVGP_LINETO_VERTICAL_ABS = 14, // SVGP_LINETO_VERTICAL_REL = 15, // SVGP_CURVETO_CUBIC_SMOOTH_ABS = 16, // SVGP_CURVETO_CUBIC_SMOOTH_REL = 17, // SVGP_CURVETO_QUADRATIC_SMOOTH_ABS = 18, // SVGP_CURVETO_QUADRATIC_SMOOTH_REL = 19 */ SVGNumber x; ///< End x SVGNumber y; ///< End y // control points for curves SVGNumber x1; ///< rx for arcs, ignored for type = {SVGP_LINETO} SVGNumber y1; ///< ry for arcs, Ignored for type = {SVGP_LINETO} SVGNumber x2; ///< xrot for arcs, ignored for types = {SVGP_LINETO, SVGP_CURVETO_QUADRATIC} SVGNumber y2; ///< Ignored for types = {SVGP_ARC, SVGP_LINETO, SVGP_CURVETO_QUADRATIC} OP_STATUS Clone(SVGPathSeg** outcopy) const; char GetSegTypeAsChar() const; public: enum SVGPathSegType { SVGP_UNKNOWN = 0, SVGP_CLOSE = 1, SVGP_MOVETO_ABS = 2, SVGP_MOVETO_REL = 3, SVGP_LINETO_ABS = 4, SVGP_LINETO_REL = 5, SVGP_CURVETO_CUBIC_ABS = 6, SVGP_CURVETO_CUBIC_REL = 7, SVGP_CURVETO_QUADRATIC_ABS = 8, SVGP_CURVETO_QUADRATIC_REL = 9, SVGP_ARC_ABS = 10, SVGP_ARC_REL = 11, SVGP_LINETO_HORIZONTAL_ABS = 12, SVGP_LINETO_HORIZONTAL_REL = 13, SVGP_LINETO_VERTICAL_ABS = 14, SVGP_LINETO_VERTICAL_REL = 15, SVGP_CURVETO_CUBIC_SMOOTH_ABS = 16, SVGP_CURVETO_CUBIC_SMOOTH_REL = 17, SVGP_CURVETO_QUADRATIC_SMOOTH_ABS = 18, SVGP_CURVETO_QUADRATIC_SMOOTH_REL = 19 }; }; #ifdef SVG_FULL_11 class SVGDOMPathSegListImpl; class SVGPathSegObject : public SVGObject { public: SVGPathSegObject() : SVGObject(SVGOBJECT_PATHSEG) {} SVGPathSegObject(const SVGPathSeg& s) : SVGObject(SVGOBJECT_PATHSEG), seg(s) {} virtual BOOL IsEqual(const SVGObject &other) const; virtual SVGObject *Clone() const { return OP_NEW(SVGPathSegObject, (seg)); } virtual OP_STATUS LowLevelGetStringRepresentation(TempBuffer* buffer) const { OP_ASSERT(0); return OpStatus::OK; } void Copy(const SVGPathSegObject& s) { seg = s.seg; } void Copy(const SVGPathSeg& s) { seg = s; } static SVGPathSeg* p(SVGPathSegObject* obj) { return obj ? &obj->seg : NULL; } static const SVGPathSeg* p(const SVGPathSegObject* obj) { return obj ? &obj->seg : NULL; } SVGPathSeg seg; OP_STATUS Sync(); BOOL IsMember() { return member.compound != NULL; } UINT32 Idx() { return member.idx; } void SetInList(SVGDOMPathSegListImpl* l) { member.list = l; } SVGDOMPathSegListImpl *GetInList() { return member.list; } static void Release(SVGPathSegObject* obj); BOOL IsValid(UINT32 idx); struct Membership { Membership() : compound(NULL), idx(0), list(NULL) {} SVGCompoundSegment* compound; ///< The compound segment this segment is part of, if any. // Index in the normalized list of the compound // list. (UINT32)-1 has a special meaning, It means that it is // a unnormalized path seg of a compound segment UINT32 idx; // A pointer to the dom list this pathseg is a part of, if // any. SVGDOMPathSegListImpl* list; } member; }; #endif // SVG_FULL_11 class NormalizedPathSegListInterface { public: virtual ~NormalizedPathSegListInterface() {} /* To keep the noise down */ virtual OP_STATUS AddNormalizedCopy(const SVGPathSeg& item) = 0; }; typedef OpAutoVector<SVGPathSeg> SVGPathSegList; #ifdef SVG_FULL_11 /* * This list is a regular OpVector, but contains reference counted * objects. This means that a successful insertion/add should be * followed by a SVGObject::IncRef on the inserted object. Like-wise * should removal of objects in the list trigger SVGObject::DecRef on * the removed objects. */ typedef OpVector<SVGPathSegObject> SVGPathSegObjectList; class SynchronizedPathSegList; class SVGCompoundSegment : public NormalizedPathSegListInterface { public: SVGCompoundSegment() : m_seg(NULL), packed_init(0) {} ~SVGCompoundSegment(); OP_STATUS Reset(SVGPathSegObject* newseg, UINT32 idx, BOOL normalized, const SVGPathSegObject* prevSeg, const SVGPathSegObject* lastMovetoNormSeg, const SVGPathSegObject* prevNormSeg, const SVGPathSegObject* prevPrevNormSeg); UINT32 GetCount() { return (packed.seg_invalid ? m_normalized_seg.GetCount() : 1); } UINT32 GetNormalizedCount() { return m_normalized_seg.GetCount(); } #ifdef _DEBUG SVGPathSegObject* GetSeg() { return m_seg; } #endif // _DEBUG SVGPathSegObject* Get(UINT32 idx) { return (packed.seg_invalid ? GetNormalized(idx) : m_seg); } SVGPathSegObject* GetNormalized(UINT32 idx) { return m_normalized_seg.Get(idx); } virtual OP_STATUS AddNormalizedCopy(const SVGPathSeg& item); OP_STATUS InsertNormalized(UINT32 idx, SVGPathSegObject* seg); OP_STATUS DeleteNormalized(UINT32 idx); OP_STATUS Split(OpVector<SVGCompoundSegment>& outlist); OP_STATUS Copy(SVGCompoundSegment* from); OP_STATUS Sync(SVGPathSegObject* obj); void InvalidateSeg(); struct Membership { Membership() : list(NULL), idx(0), normidx(0) {} SynchronizedPathSegList* list; ///< The path-segment list this compound segment is part of, if any UINT32 idx; ///< The index in the unnormalized list UINT32 normidx; ///< The index in the normalized list } member; void UpdateMembership(); protected: void SetSegment(SVGPathSegObject* seg) { m_seg = seg; SVGObject::IncRef(m_seg); } static void EmptyPathSegObjectList(SVGPathSegObjectList& lst); private: SVGPathSegObject* m_seg; SVGPathSegObjectList m_normalized_seg; union { struct { unsigned int seg_invalid:1; } packed; unsigned int packed_init; }; }; #endif // SVG_FULL_11 class NormalizedPathSegList; class SynchronizedPathSegList; class PathSegList; class PathSegListIterator { public: virtual ~PathSegListIterator() {} /* To keep the noise down */ virtual SVGPathSeg* GetNext() = 0; #ifdef SVG_FULL_11 virtual SVGPathSegObject* GetNextObject() = 0; #endif // SVG_FULL_11 virtual void Reset() = 0; }; class PathSegList { public: virtual ~PathSegList() {} virtual NormalizedPathSegList* GetAsNormalizedPathSegList() { return NULL; } virtual SynchronizedPathSegList* GetAsSynchronizedPathSegList() { return NULL; } virtual OP_STATUS Copy(PathSegList* plist) = 0; virtual OP_STATUS AddCopy(const SVGPathSeg& item) = 0; #ifdef SVG_FULL_11 virtual OP_STATUS Add(SVGPathSegObject* seg) = 0; virtual OP_STATUS Insert(UINT32 idx, SVGPathSegObject* newval, BOOL normalized) = 0; virtual OP_STATUS Replace(UINT32 idx, SVGPathSegObject* newval, BOOL normalized) = 0; virtual OP_STATUS Delete(UINT32 idx, BOOL normalized) = 0; virtual SVGPathSegObject* Get(UINT32 idx, BOOL normalized = TRUE) const = 0; #endif // SVG_FULL_11 virtual void Clear() = 0; virtual UINT32 GetCount(BOOL normalized = TRUE) const = 0; virtual PathSegListIterator* GetIterator(BOOL normalized = TRUE) const = 0; const SVGBoundingBox& GetBoundingBox() const { return m_bbox; } virtual void CompactPathList() {} void RebuildBoundingBox(); protected: SVGBoundingBox m_bbox; }; class NormalizedPathSegList : public PathSegList, public NormalizedPathSegListInterface { public: NormalizedPathSegList() #ifdef FLAT_SEGMENT_STORAGE : m_segment_array(NULL), m_segment_array_size(0), m_segment_array_used(0) #endif // FLAT_SEGMENT_STORAGE #ifdef KEEP_LAST_MOVETO_INDEX # ifdef FLAT_SEGMENT_STORAGE , # else : #endif // FLAT_SEGMENT_STORAGE m_last_explicit_moveto_index(-1) #endif // KEEP_LAST_MOVETO_INDEX {} virtual ~NormalizedPathSegList() { #ifdef FLAT_SEGMENT_STORAGE OP_DELETEA(m_segment_array); #endif // FLAT_SEGMENT_STORAGE } virtual NormalizedPathSegList* GetAsNormalizedPathSegList() { return this; } virtual OP_STATUS Copy(PathSegList* plist); virtual OP_STATUS AddCopy(const SVGPathSeg& item); virtual OP_STATUS AddNormalizedCopy(const SVGPathSeg& item); virtual UINT32 GetCount(BOOL normalized = TRUE) const; #ifdef SVG_FULL_11 virtual OP_STATUS Add(SVGPathSegObject* newval); virtual OP_STATUS Insert(UINT32 idx, SVGPathSegObject* newval, BOOL normalized); virtual OP_STATUS Replace(UINT32 idx, SVGPathSegObject* newval, BOOL normalized); virtual OP_STATUS Delete(UINT32 idx, BOOL normalized); virtual SVGPathSegObject* Get(UINT32 idx, BOOL normalized = TRUE) const; #endif // SVG_FULL_11 #ifdef SVG_TINY_12 SVGPathSeg* GetPathSeg(UINT32 idx) const { #ifdef FLAT_SEGMENT_STORAGE if(m_segment_array && idx < m_segment_array_used) { return &m_segment_array[idx]; } return NULL; #else return m_segments.Get(idx); #endif // FLAT_SEGMENT_STORAGE } #endif // SVG_TINY_12 virtual void Clear(); virtual void CompactPathList() { if (m_segment_array_used != m_segment_array_size) { OpStatus::Ignore(SetArraySize(m_segment_array_used)); // else ignore the OOM (hmprf, failing to save memory because of an OOM) } } #ifdef FLAT_SEGMENT_STORAGE void SetAllocationStepSize(UINT32 step) { if (!m_segment_array && step > 0) { m_segment_array = OP_NEWA(SVGPathSeg, step); if (m_segment_array) { // If OOM we'll just allocate it again when needed and // then we can propagate the OOM m_segment_array_size = step; } } } #else void SetAllocationStepSize(UINT32 step) { m_segments.SetAllocationStepSize(step); } #endif class Iterator : public PathSegListIterator { public: virtual SVGPathSeg* GetNext(); #ifdef SVG_FULL_11 virtual SVGPathSegObject* GetNextObject() { return NULL; } #endif // SVG_FULL_11 virtual void Reset() { m_index = 0; } private: friend class NormalizedPathSegList; Iterator(const NormalizedPathSegList* path, INT32 idx) : m_path(path), m_index(idx) {} const NormalizedPathSegList* m_path; INT32 m_index; }; virtual PathSegListIterator* GetIterator(BOOL normalized = TRUE) const { //OP_ASSERT(normalized == TRUE); // Otherwise we get unexpected results return OP_NEW(NormalizedPathSegList::Iterator, (this, 0)); } private: friend class Iterator; NormalizedPathSegList(const NormalizedPathSegList& other); // No implementation - this is not copyable void operator=(const NormalizedPathSegList& rhs); // No implementation - this is not copyable OP_STATUS SetArraySize(UINT32 new_size); SVGPathSeg m_last_added_seg; #ifdef FLAT_SEGMENT_STORAGE SVGPathSeg* m_segment_array; UINT32 m_segment_array_size; UINT32 m_segment_array_used; #else OpAutoVector<SVGPathSeg> m_segments; #endif // FLAT_SEGMENT_STORAGE #ifdef KEEP_LAST_MOVETO_INDEX int m_last_explicit_moveto_index; #endif // KEEP_LAST_MOVETO_INDEX }; #ifdef SVG_FULL_11 /** * This class acts as a backing store for OpBpath, * handling syncing of normalized/unnormalized segments */ class SynchronizedPathSegList : public PathSegList { public: SynchronizedPathSegList(); virtual ~SynchronizedPathSegList() {} virtual SynchronizedPathSegList* GetAsSynchronizedPathSegList() { return this; } virtual OP_STATUS Copy(PathSegList* plist); virtual OP_STATUS AddCopy(const SVGPathSeg& item); virtual OP_STATUS Add(SVGPathSegObject* newval); virtual OP_STATUS Insert(UINT32 idx, SVGPathSegObject* newval, BOOL normalized); virtual OP_STATUS Replace(UINT32 idx, SVGPathSegObject* newval, BOOL normalized); virtual OP_STATUS Delete(UINT32 idx, BOOL normalized); virtual void Clear(); virtual UINT32 GetCount(BOOL normalized = TRUE) const; virtual SVGPathSegObject* Get(UINT32 idx, BOOL normalized = TRUE) const; class Iterator : public PathSegListIterator { public: virtual SVGPathSeg* GetNext(); virtual SVGPathSegObject* GetNextObject(); virtual void Reset() { compidx = 0; segidx = 0; } private: friend class SynchronizedPathSegList; Iterator(const SynchronizedPathSegList* path, BOOL normalized) : path(path), compidx(0), segidx(0), normalized(normalized) {} const SynchronizedPathSegList* path; INT32 compidx; INT32 segidx; BOOL normalized; }; virtual PathSegListIterator* GetIterator(BOOL normalized = TRUE) const { return OP_NEW(SynchronizedPathSegList::Iterator, (this, normalized)); } OP_STATUS Sync(UINT32 comp_idx, SVGPathSegObject* obj); protected: OP_STATUS SetupNewSegment(SVGCompoundSegment* newseg, SVGPathSegObject* newval, INT32 compidx, INT32 segidx, BOOL normalized); INT32 CompoundIndex(UINT32 idx, BOOL normalized, INT32& segindex) const; const SVGPathSegObject* GetPrevSeg(INT32 compidx, INT32 segidx); void UpdateMembership(UINT32 start_segment_index = 0); void PrevNormIdx(INT32& compidx, INT32& segidx); const SVGPathSegObject* FindLastMoveTo(INT32 idx, INT32 segidx); SVGPathSegObject* GetNormSeg(INT32 compidx, INT32 segidx) const; SVGPathSegObject* GetSeg(INT32 compidx, INT32 segidx) const; private: friend class Iterator; #ifdef SVG_PATH_EXPENSIVE_SYNC_TESTS void CheckSync() const; #endif // _DEBUG OpAutoVector<SVGCompoundSegment> m_segments; UINT32 m_normalized_count; UINT32 m_count; }; #endif // SVG_FULL_11 class SVGBoundingBox; /** * This class defines a curve that may contain the following * operations: moveto, lineto, {quadratic,cubic}curveto and arcto. */ class OpBpath : public SVGObject, public SVGPath { private: OpBpath(); public: static OP_STATUS Make(OpBpath*& outpath, BOOL used_by_dom = TRUE, UINT32 number_of_segments_hint = 0); /** Deletes the path including all path commands and subpaths. */ virtual ~OpBpath(); virtual BOOL IsEqual(const SVGObject& obj) const; OP_STATUS Interpolate(const OpBpath &p1, const OpBpath& p2, SVG_ANIMATION_INTERVAL_POSITION interval_position); OP_STATUS Copy(const OpBpath &p1); virtual SVGObject *Clone() const; virtual OP_STATUS LowLevelGetStringRepresentation(TempBuffer* buffer) const; virtual BOOL InitializeAnimationValue(SVGAnimationValue& animation_value); /** * Move to the specified coordinate. Doing this will create a new * path segment and the old segment (if any) will be left open. If * you want the old path segment to be closed, then you need to * call OpBpath::Close() before doing the moveto. If you call * MoveTo several times in a row without anything else in between * the first MoveTo will be interpreted as a MoveTo and the * remaining ones will be interpreted as LineTo. * * @param x The x position * @param y The y position * @param relative TRUE if the given (x,y) are relative to the current position, FALSE if the values are absolute */ #ifdef MoveTo #define oldmoveto MoveTo #undef MoveTo #endif virtual OP_STATUS MoveTo(SVGNumber x, SVGNumber y, BOOL relative); /** * Move to the specified coordinate. Doing this will create a new * path segment and the old segment (if any) will be left open. * If you want the old path segment to be closed, then you need to * call OpBpath::Close() before doing the moveto. * * This is a convinience function * * @param x The x position * @param y The y position * @param relative TRUE if the given (x,y) are relative to the current position, FALSE if the values are absolute */ OP_STATUS MoveTo(const SVGNumberPair& coord, BOOL relative, BOOL is_explicit = TRUE); #ifdef oldmoveto #define MoveTo oldmoveto #undef oldmoveto #endif OP_STATUS CommonMoveTo(SVGNumber x, SVGNumber y, BOOL relative, BOOL is_explicit = TRUE); /** * Line to the specified coordinate. * * This is a convinence function * * @param x The end x position * @param y The end y position * @param relative TRUE if the given (x,y) are relative to the current position, FALSE if the values are absolute */ virtual OP_STATUS LineTo(const SVGNumberPair& coord, BOOL relative); /** * Line to the specified coordinate. * * @param x The end x position * @param y The end y position * @param relative TRUE if the given (x,y) are relative to the current position, FALSE if the values are absolute */ virtual OP_STATUS LineTo(SVGNumber x, SVGNumber y, BOOL relative); /** * Horizontal straight line to the specified x coordinate. * * @param x The x position * @param relative TRUE if the given x is relative to the current position, FALSE if the value is absolute */ virtual OP_STATUS HLineTo(SVGNumber x, BOOL relative); /** * Vertical straight line to the specified y coordinate. * * @param y The y position * @param relative TRUE if the given y is relative to the current position, FALSE if the value is absolute */ virtual OP_STATUS VLineTo(SVGNumber y, BOOL relative); /** * Cubic Bezier curve to. * * If you pass smooth=TRUE then the first control point is assumed * to be the reflection of the second control point on the previous * command relative to the current point. If there is no previous * command or if the previous command was not a cubic curve, assume * the first control point is coincident with the current point. * * @param cp1x The first controlpoint x coordinate * @param cp1y The first controlpoint y coordinate * @param cp2x The second controlpoint x coordinate * @param cp2y The second controlpoint y coordinate * @param endx The end x coordinate * @param endy The end y coordinate * @param smooth If TRUE then the first controlpoint will be calculated for you, you only need to pass the second controlpoint and endpoint * @param relative TRUE if the given coordinates are relative to the current position, FALSE if the values are absolute */ virtual OP_STATUS CubicCurveTo( SVGNumber cp1x, SVGNumber cp1y, SVGNumber cp2x, SVGNumber cp2y, SVGNumber endx, SVGNumber endy, BOOL smooth, BOOL relative); /** * Quadratic Bezier curve to. * * If you pass smooth=TRUE then the control point is assumed to be * the reflection of the control point on the previous command * relative to the current point. If there is no previous command * or if the previous command was not a quadratic curve, assume the * control point is coincident with the current point. * * @param cp1x The first controlpoint x coordinate * @param cp1y The first controlpoint y coordinate * @param endx The end x coordinate * @param endy The end y coordinate * @param smooth If TRUE then the first controlpoint will be calculated for you, you only need to pass the second controlpoint and endpoint * @param relative TRUE if the given coordinates are relative to the current position, FALSE if the values are absolute */ virtual OP_STATUS QuadraticCurveTo( SVGNumber cp1x, SVGNumber cp1y, SVGNumber endx, SVGNumber endy, BOOL smooth, BOOL relative); /** * Arc to. * * Add an elliptical arc from the current point to (x, y). The * size and orientation of the ellipsi are defined by two radii * (rx, ry) and an x-axis rotation. * * @param rx The x radius * @param ry The y radius * @param xrot The rotation in degrees around the x-axis * @param large If TRUE then choose the largest arc * @param sweep If TRUE arc will be drawn in a "positive-angle" direction * @param x The end x coordinate * @param y The end y coordinate */ virtual OP_STATUS ArcTo(SVGNumber rx, SVGNumber ry, SVGNumber xrot, BOOL large, BOOL sweep, SVGNumber x, SVGNumber y, BOOL relative); /** * Close this path segment. You can still add other commands after * doing this, it just means this segment is closed. Paths are not * automatically closed for you, the default is to create open * paths. */ virtual OP_STATUS Close(); /** * Reduces memory usage for the path, but potentially makes * changes to it slower. */ void CompactPath() { m_pathlist->CompactPathList(); } #ifdef SVG_FULL_11 // Slow random access methods SVGPathSegObject* Get(UINT32 idx, BOOL normalized = TRUE) const { return m_pathlist->Get(idx, normalized); } OP_STATUS Set(UINT32 idx, const SVGPathSeg& val, BOOL normalized = TRUE) { SVGPathSegObject* copy = NULL; copy = OP_NEW(SVGPathSegObject, (val)); if (!copy) return OpStatus::ERR_NO_MEMORY; return m_pathlist->Replace(idx, copy, normalized); } OP_STATUS Add(SVGPathSegObject* newval) { return m_pathlist->Add(newval); } OP_STATUS Insert(UINT32 idx, SVGPathSegObject* newval, BOOL normalized) { return m_pathlist->Insert(idx, newval, normalized); } OP_STATUS Replace(UINT32 idx, SVGPathSegObject* newval, BOOL normalized) { if (!newval) return OpStatus::ERR_NULL_POINTER; return m_pathlist->Replace(idx, newval, normalized); } OP_STATUS Delete(UINT32 idx, BOOL normalized) { return m_pathlist->Delete(idx, normalized); } #endif // SVG_FULL_11 #ifdef SVG_TINY_12 /** Gets the SVGPathSeg at specified index in the normalized list. */ SVGPathSeg* GetPathSeg(UINT32 idx) const { NormalizedPathSegList* nl = m_pathlist->GetAsNormalizedPathSegList(); if(nl) return nl->GetPathSeg(idx); return NULL; } #endif // SVG_TINY_12 UINT32 GetCount(BOOL normalized = TRUE) const { return m_pathlist->GetCount(normalized); } OP_STATUS AddCopy(const SVGPathSeg& newval) { return m_pathlist->AddCopy(newval); } void Clear() { m_pathlist->Clear(); } OP_STATUS SetUsedByDOM(BOOL val); /** * Gets the boundingbox for the entire path. * @return bbox The boundingbox (output) */ const SVGBoundingBox& GetBoundingBox() const { return m_pathlist->GetBoundingBox(); } OP_STATUS Concat(const OpBpath &p1); /** * Call this if you have manually changed values in * the path to make sure the bounding box is still valid. */ void RecalculateBoundingBox() { m_pathlist->RebuildBoundingBox(); } static void UpdateBoundingBox(const SVGNumberPair& curr_pt, const SVGPathSeg* cmd, SVGBoundingBox &bbox); /** * Convert all segments in the path to cubic bezier curves. * MoveTos are unaffected. * @param newpath The new path will be returned here * @return OpStatus::OK if successful */ OP_STATUS Bezierize(OpBpath** newpath) const; /** * Convert an arc segment into bezier and append to the outlist. * @param arcseg The arc segment to convert * @param outlist The result will be appended to this list * @return OpStatus::OK if successful */ static OP_STATUS ConvertArcToBezier(const SVGPathSeg* arcseg, SVGNumberPair& ioCurrentPos, SVGPathSeg* outlist, UINT32& outsize); /** * Iterator interface for OpBpath * @param normalized TRUE if the iterator should iterate over the normalized path * @return Iterator with reference to the first path segment */ PathSegListIterator* GetPathIterator(BOOL normalized) const { return m_pathlist->GetIterator(normalized); } static OP_STATUS NormalizeSegment(const SVGPathSeg* seg, const SVGPathSeg* prevSeg, const SVGPathSeg* lastMovetoNormSeg, const SVGPathSeg* prevNormSeg, const SVGPathSeg* prevPrevNormSeg, NormalizedPathSegListInterface* outlist); static void ConvertQuadraticToCubic(SVGNumber cp1x, SVGNumber cp1y, SVGNumber endx, SVGNumber endy, BOOL relative, SVGNumber curx, SVGNumber cury, SVGPathSeg& cubiccmd); #ifdef COMPRESS_PATH_STRINGS OP_STATUS SetString(const uni_char *str, UINT32 len); #else OP_STATUS SetString(const uni_char *str, UINT32 len) { return m_str_rep_utf8.SetUTF8FromUTF16(str, len); } #endif // COMPRESS_PATH_STRINGS protected: void PrepareInterpolatedCmd(const SVGPathSeg* c1, SVGNumberPair current_point, SVGPathSeg& out); BOOL GetInterpolatedCmd(const SVGPathSeg* c1, const SVGPathSeg* c2, SVGPathSeg& c3, SVGNumber where); BOOL AddCmdSum(const SVGPathSeg& c1, const SVGPathSeg& c2); static OP_STATUS LowConvertArcToBezier(const SVGPathSeg* arcseg, SVGNumberPair& ioCurrentPos, SVGPathSeg* outlist, UINT32& outsize); private: PathSegList* m_pathlist; SVGNumberPair m_current_pos; #ifdef COMPRESS_PATH_STRINGS /** * Compressed string representation of the string, or NULL if * there isn't any. */ UINT8* m_compressed_str_rep; /** * If m_compressed_str_rep_utf8 is != NULL, then this is the * length of the buffer. */ int m_compressed_str_rep_length; #endif // COMPRESS_PATH_STRINGS }; typedef OpAutoVector<OpBpath> OpBpathList; #endif // SVG_SUPPORT #endif // OPBPATH_H
#include <stdlib.h> #include <GL/glut.h> //global variable int connection = 1; //control points which control the curvature GLfloat controlPoints[6][3] = { {-4.0, -4.0, 0.0}, {-2.0, 4.0, 0.0}, {-3.0, -3.0, 0.0 }, { 4.0, 4.0, 0.0 }, { 2.0, -4.0, 0.0 }, { 3.0, 2.0, 0.0 }}; void init(void) { glClearColor(0.0, 0.0, 0.0, 0.0); glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &controlPoints[0][0]); glEnable(GL_MAP1_VERTEX_3); } //display function void display(void) { glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glBegin(GL_LINE_STRIP); //evaluating the intermediate points for (int i = 0;i <= connection;i++) glEvalCoord1f((GLfloat)i / (GLfloat)connection); glEnd(); //displaying the connection dots with different colors and size glPointSize(5.0); glColor3f(1.0, 1.0, 0.0); glBegin(GL_POINTS); for (int i = 0;i < 6;i++) //drawing the control points from the array glVertex3fv(&controlPoints[i][0]); glEnd(); glFlush(); } //resahpe function void reshape(int w, int h) { glViewport(0, 0, (GLsizei)w, (GLsizei)h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (w <= h) glOrtho(-5.0, 5.0, -5.0 * (GLfloat)h / (GLfloat)w, 5.0 * (GLfloat)h / (GLfloat)w, -5.0, 5.0); else glOrtho(-5.0 *(GLfloat)w / (GLfloat)h, 5.0 * (GLfloat)w / (GLfloat)h, -5.0, 5.0,-5.0,5.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } //keyboard Interactive function void Keyboard(unsigned char key, int x, int y) { switch (key){ //if esc is pressed case 27: exit(0); break; //if + buton is pressed case '+': connection++; break; //if - button is pressed case '-': connection--; break; default: break; } if (connection < 0) connection = 0; glutPostRedisplay(); } int main(int argc,char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(500, 500); glutInitWindowPosition(100, 100); glutCreateWindow(argv[0]); init(); glutDisplayFunc(display); glutReshapeFunc(reshape); glutKeyboardFunc(Keyboard); glutMainLoop(); return 0; }
#include <QtGui/QApplication> #include "chekinadmin.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); chekinadmin w; w.show(); return a.exec(); }
//Created by: Mark Marsala, Marshall Farris, and Johnathon Franco Sosa //Date: 5/4/2021 //Header file for echo class #ifndef ECHO_H #define ECHO_H #include <iostream> /** * Class that creates an echo effect for the wav file */ class Echo{ int delay; public: /** * Constructor for the Echo class */ Echo(); /** * Paramaterized constructor for the Echo class * @param newDelay - the new delay that will be added to the wav file */ Echo(int newDelay); /** * Destructor for the Echo class */ virtual ~Echo(); /** * Template for mono files * @param mono - type mono */ template<typename mono> /** * Process buffer for type mono * @param buffer - buffer for the file * @param bufferSize - size of the buffer in the file */ void processBuffer(mono buffer, int bufferSize){ std::cout << "in echo processorBuffer" << std::endl; for(int i = 0; i <= bufferSize - delay; i++){ buffer[i] = ((buffer[i] + buffer[i+delay]) * 0.5); } } /** * Template for stereo files * @param stereo - type stereo */ template<typename stereo> /** * Process buffer for type stereo * @param leftBuffer - left buffer in stereo file * @param rightBuffer - right buffer in stereo file * @param bufferSize - buffer size of the stereo file */ void processBuffer(stereo rightBuffer, stereo leftBuffer, int bufferSize){ std::cout << "in echo processorBuffer" << std::endl; for(int i = 0; i <= bufferSize - delay; i++){ leftBuffer[i] = ((leftBuffer[i] + leftBuffer[i+delay]) * 0.5); rightBuffer[i] = ((rightBuffer[i] + rightBuffer[i+delay]) * 0.5); } } }; #endif
/// For Education Purpose /// Author: EstKey #include "stdafx.hpp" int main(char* argv[], int argc) { //sll::sllUI(); // Single Linked list //da::daUI(); //Dynamic Array //as::asUI(); //Array Stack //ls::lsUI(); //Linked Stack //aq::aqUI(); //Array Queue //sq::sqUI(); //Stack QUeue printf("Compiled Successfully"); while (getchar() != '\n'); return 0; }//main() void ui(char *argv[], int argc) { printf("\\\***Welcom to Data Structure Study***///\n"); }
#include "aeTime.h" #include "aeString.h" #include <windows.h> namespace aeEngineSDK { /*************************************************************************************************/ /* @struct TIME_DATA /* /* @brief Time data. /*************************************************************************************************/ struct TIME_DATA { float TimeScale; int64 Reference; int64 Start; }; float GetFrequency() {// get ticks per second LARGE_INTEGER frequency; QueryPerformanceFrequency(&frequency); return 1.0f / frequency.QuadPart; } const float FREQUENCY = GetFrequency(); aeTime::aeTime() { m_pData = ae_new<TIME_DATA>(); } aeTime::aeTime(const aeTime& T) { *this = T; } aeTime::~aeTime() { ae_delete(m_pData); } void aeTime::Start(float Scale) { // Establish the time scale m_pData->TimeScale = Scale; // start timer LARGE_INTEGER t; QueryPerformanceCounter(&t); m_pData->Reference = m_pData->Start = t.QuadPart; } TIME_T aeTime::Time() { return (TIME_T)time(0); } TIME_STAMP aeTime::GMTime(const TIME_T* T) { time_t tt = (time_t)*T; tm * ptm = nullptr; ptm = gmtime(&tt); TIME_STAMP t; t.Seconds = ptm->tm_sec; t.Minutes = ptm->tm_min; t.Hours = ptm->tm_hour; t.Day = ptm->tm_mday; t.Month = ptm->tm_mon+1; t.Year = ptm->tm_year + 1900; t.WeekDay = ptm->tm_wday; t.YearDay = ptm->tm_yday; t.IsDST = ptm->tm_isdst; return t; } TIME_STAMP aeTime::LocalTime(const TIME_T* T) { time_t tt = (time_t)*T; tm * ptm = nullptr; ptm = localtime(&tt); TIME_STAMP t; t.Seconds = ptm->tm_sec; t.Minutes = ptm->tm_min; t.Hours = ptm->tm_hour; t.Day = ptm->tm_mday; t.Month = ptm->tm_mon+1; t.Year = ptm->tm_year+1900; t.WeekDay = ptm->tm_wday; t.YearDay = ptm->tm_yday; t.IsDST = ptm->tm_isdst; return t; } String aeTime::GetTimeStamp() { String str; TIME_T T = Time(); TIME_STAMP TS = LocalTime(&T); str += ToString(TS.Year); if (TS.Month<10) str += "0"; str += ToString(TS.Month); str += ToString(TS.Day); str += "T"; if (TS.Hours<10) str += "0"; str += ToString(TS.Hours); if (TS.Minutes<10) str += "0"; str += ToString(TS.Minutes); if (TS.Seconds<10) str += "0"; str += ToString(TS.Seconds); return str; } float aeTime::DeltaTime() { return m_pData->TimeScale * FixedDeltaTime(); } float aeTime::FixedDeltaTime() { LARGE_INTEGER t; QueryPerformanceCounter(&t); float Delta = FREQUENCY * (t.QuadPart - m_pData->Reference); m_pData->Reference = t.QuadPart; return Delta; } float aeTime::TimeSinceStart() const { LARGE_INTEGER t; QueryPerformanceCounter(&t); return (FREQUENCY * (t.QuadPart - m_pData->Start)); } float aeTime::GetTimeScale() const { return m_pData->TimeScale; } void aeTime::SetTimeScale(const float & Scale) { if (Scale >= 0) m_pData->TimeScale = Scale; } }
/************************************************************************************** * File Name : ChatBox.hpp * Project Name : Keyboard Warriors * Primary Author : JeongHak Kim * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserved." **************************************************************************************/ #pragma once #include <string> #include <array> #include "Material.hpp" #include "Transform.hpp" #include "BitmapFont.hpp" #include "Text.hpp" class ChatBox { public: void Initialize(mat3<float> world_to_ndc) noexcept; void AddHistory(std::wstring message) noexcept; void DrawMessageBox() noexcept; private: std::array<std::wstring, 3> history; int index = 0; mat3<float> worldToNDC; Color4f chatBoxColor = { 0.0f, 0.36f, 0.56f, 0.6f }; Material chatBox; Shader chatBoxShader; Shader textShader; Transform chatBoxTransform; Transform textTransform; BitmapFont bitmapFont; Text text; };
// Fill out your copyright notice in the Description page of Project Settings. #include "TabletProject.h" #include "Modules/ModuleManager.h" IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, TabletProject, "TabletProject" );
#include "articuloqueue.h" #include <cstddef> ArticuloQueue::ArticuloQueue() { //ctor this->start = NULL; this->end = NULL; } ArticuloQueue::~ArticuloQueue() { //dtor this->free(); } Articulo* ArticuloQueue::retrieve() { if (!start) return NULL; Articulo* value = start->getArticulo(); ArticuloNode* aux = start; start = start->getNext(); delete aux; if (!start) end = NULL; return value; } void ArticuloQueue::add(Articulo* articulo) { ArticuloNode* newArticuloNode = new ArticuloNode(articulo); if (!start) { start = end = newArticuloNode; return; } end->setNext(newArticuloNode); end = newArticuloNode; } ArticuloNode* ArticuloQueue::getStart() { return start; } void ArticuloQueue::setStart(ArticuloNode* start) { this->start = start; } ArticuloNode* ArticuloQueue::getEnd() { return end; } void ArticuloQueue::setEnd(ArticuloNode* end) { this->end = end; } void ArticuloQueue::free() { while (ArticuloNode* aux = start) { start = start->getNext(); delete aux; } } void ArticuloQueue::show() { ArticuloNode* aux = start; while (aux) { aux->show(); cout << endl; aux = aux->getNext(); } cout << endl << endl; }
/* Problem: 1008 Author: Kevin Washington (@kevinwsbr) */ #include <iostream> #include <stdio.h> using namespace std; int main(){ int a, b; float c; cin >> a; cin >> b; cin >> c; printf("NUMBER = %d\n", a); printf("SALARY = U$ %.2f\n", b*c); return 0; }
#pragma once #include <string> #include <iostream> #include <map> class SpelledNums { std::map<int, std::string> Num2Letter; int i_input; public: SpelledNums(); std::string Parse(std::string input); };
// ************************************** // File: KCheckboxView.h // Copyright: Copyright(C) 2013-2017 Wuhan KOTEI Informatics Co., Ltd. All rights reserved. // Website: http://www.nuiengine.com // Description: This code is part of NUI Engine (NUI Graphics Lib) // Comments: // Rev: 2 // Created: 2017/4/12 // Last edit: 2017/4/28 // Author: Chen Zhi // E-mail: cz_666@qq.com // License: APACHE V2.0 (see license file) // *************************************** #ifndef KCheckboxView_DEFINED #define KCheckboxView_DEFINED #include "KButtonView.h" #include "KViewGroup.h" class NUI_API KCheckboxView : public KTextView { public: KCheckboxView(); virtual ~KCheckboxView(); virtual void shared_ptr_inited(); virtual void setCheck(kn_bool b); kn_bool getCheck(); virtual void onClick(kn_int x, kn_int y, KMessageMouse* pMsg); // 设置资源: 选中图标 、未选中图标、文字 void setResourse(const kn_string& strClickResPath, const kn_string& strUnclickResPath, const kn_string& strMessage); void setResourse(IRESurface* , IRESurface* , const kn_string& strMessage); //void setResourseDrawable( KDrawable_PTR daChecked, KDrawable_PTR daUnchecked, KDrawable_PTR daMessage); void setResourseDrawable( KDrawable_PTR daChecked, KDrawable_PTR daUnchecked, const kn_string& strMessage);//huw // 选中状态改变,参数为改变后的状态 sigslot::signal1<kn_bool> m_sign_state_changed; void SetCenter(); protected: void showCheck(); protected: kn_bool m_b_check; KDrawable_PTR m_drawable_checked; KDrawable_PTR m_drawable_unchecked; //KDrawable_PTR m_drawable_message; }; typedef boost::shared_ptr<KCheckboxView> KCheckboxView_PTR; class NUI_API KRadioboxView : public KCheckboxView { public: KRadioboxView() ; virtual ~KRadioboxView(); virtual void onClick(kn_int x, kn_int y, KMessageMouse* pMsg); }; typedef boost::shared_ptr<KRadioboxView> KRadioboxView_PTR; class NUI_API KRadioboxGroup : public KViewGroup { public: KRadioboxGroup(); virtual ~KRadioboxGroup(); void SetGroupCheck(KRadioboxView_PTR pCheckedView); void SetSelectedIndex(kn_int index); kn_int GetSelectedIndex (); KRadioboxView_PTR GetSelectedView (); // 选中项改变,参数为改变后的状态 sigslot::signal1<kn_int> m_sign_index_changed; sigslot::signal1<KRadioboxView_PTR> m_sign_selectedview_changed; protected: kn_int m_i_selected_index; KRadioboxView_PTR m_p_selected_view; }; typedef boost::shared_ptr<KRadioboxGroup> KRadioboxGroup_PTR; #endif
/* leetcode 146 * * * */ #include <unordered_map>; using namespace std; struct DLinkNode { int key, value; DLinkNode* prev; DLinkNode* next; DLinkNode():key(0), value(0), prev(nullptr), next(nullptr) {} DLinkNode(int _key, int _value):key(_key), value(_value), prev(nullptr), next(nullptr) {} }; class LRUCache { private: unordered_map<int, DLinkNode*> cache; DLinkNode* head; // latest use DLinkNode* tail; // earliest use int _size; int _capacity; public: LRUCache(int capacity) { _capacity = capacity; _size = 0; head = new DLinkNode(); tail = new DLinkNode(); head->next = tail; tail->prev = head; } void addToHead(DLinkNode* node) { node->next = head->next; head->next->prev = node; node->prev = head; head->next = node; } void removeNode(DLinkNode* node) { // node must be in the dlinklist node->next->prev = node->prev; node->prev->next = node->next; } void moveToHead(DLinkNode* node) { // node must be in the dlinklist removeNode(node); addToHead(node); } DLinkNode* removeTail() { DLinkNode* node = tail->prev; removeNode(node); return node; } int get(int key) { if(cache.count(key) == 0) { return -1; } DLinkNode* node = cache[key]; moveToHead(node); return node->value; } void put(int key, int value) { if(cache.count(key)) { DLinkNode* node = cache[key]; node->value = value; moveToHead(node); } else { if (_size < _capacity) { DLinkNode* node = new DLinkNode(key, value); addToHead(node); moveToHead(node); cache.insert(make_pair(key, node)); _size++; } else { int oldKey = tail->prev->key; removeNode(tail->prev); DLinkNode* node = new DLinkNode(key, value); addToHead(node); moveToHead(node); cache.insert(make_pair(key, node)); cache.erase(oldKey); } } } }; /** * Your LRUCache object will be instantiated and called as such: * LRUCache* obj = new LRUCache(capacity); * int param_1 = obj->get(key); * obj->put(key,value); */ /************************** run solution **************************/ bool _solution_run(DLinkNode *head) { return false; } #ifdef USE_SOLUTION_CUSTOM string _solution_custom(TestCases &tc) { vector<string> sf = tc.get<vector<string>>(); vector<string> sp = tc.get<vector<string>>(); vector<string> ans; LRUCache* obj = nullptr; for(size_t i = 0; i < sf.size(); i++) { if(sf[i] == "LRUCache") { TestCases stc(sp[i]); int capacity = stc.get<int>(); obj = new LRUCache(capacity); ans.push_back("null"); } else if(sf[i] == "put") { TestCases stc(sp[i]); int key = stc.get<int>(); int value = stc.get<int>(); obj->put(key, value); ans.push_back("null"); } else if(sf[i] == "get") { TestCases stc(sp[i]); int key = stc.get<int>(); int ret = obj->get(key); ans.push_back(convert<string>(ret)); } } delete obj; return convert<string>(ans); } #endif /************************** get testcase **************************/ #ifdef USE_GET_TEST_CASES_IN_CPP vector<string> _get_test_cases_string() { return {}; } #endif
#ifndef GUARD_MEMdataConverter #define GUARD_MEMdataConverter #include <iostream> #include <string> #include <vector> #include "BaseConverter.hh" namespace xdaq { class ApplicationContext; } namespace xdaq { class ApplicationDescriptor; } class MEMdataConverter: public BaseConverter { public: MEMdataConverter(xdaq::ApplicationContext* appContext, DipFactory*, const std::string&); ~MEMdataConverter(); void setConversion(std::string&, std::string&, std::string&, bool, bool, xdaq::ApplicationDescriptor*, xdaq::ApplicationDescriptor*, unsigned int); void Convert(const std::string&, std::vector<float>&); private: std::string DataPath; std::string SMnumber; std::string SMxPVSS; bool EnablePVSS; bool TestMode; xdaq::ApplicationDescriptor* appPVSS; xdaq::ApplicationDescriptor* appDCU; unsigned int nCCU; std::vector<DipData*> data; std::vector<DipPublication*> pubArray; std::vector<std::string> usedSector; }; #endif
#ifndef __BATON_H__ #define __BATON_H__ #include <nan.h> #include <iostream> using namespace v8; typedef std::shared_ptr<Nan::Persistent<Function>> PersistentCallback; extern int nextBatonID; template<class T> class Baton { public: Baton(T *object, PersistentCallback callback) : id(++nextBatonID), instance(object), callback(callback) {} virtual ~Baton() {} int id; T *instance; PersistentCallback callback; }; template<class T> class NodeInvocationBaton : public Baton<T> { public: NodeInvocationBaton(T *object, PersistentCallback callback) : Baton<T>(object, callback), name(), arguments(), result(), dispatchNode(nullptr), dispatchAsync(nullptr), mutex(nullptr), condition(nullptr) {} virtual ~NodeInvocationBaton() { closeNodeDispatch(); closeAsyncDispatch(); closeMutex(); closeCondition(); } // function name, arguments, and its result std::string name; std::string arguments; std::string result; // node dispatch uv_async_t *dispatchNode; // async mode, used to signal the sandbox loop to wake up after the node call finishes uv_async_t *dispatchAsync; // sync mode, used to synchronously wait for the nodejs thread to provide a result uv_mutex_t *mutex; uv_cond_t *condition; void closeNodeDispatch() { if (dispatchNode) { uv_close((uv_handle_t *)dispatchNode, OnClose); dispatchNode = nullptr; } } void closeAsyncDispatch() { if (dispatchAsync) { uv_close((uv_handle_t *)dispatchAsync, OnClose); dispatchAsync = nullptr; } } void closeMutex() { if (mutex) { uv_mutex_destroy(mutex); delete mutex; mutex = nullptr; } } void closeCondition() { if (condition) { uv_cond_destroy(condition); delete condition; condition = nullptr; } } static void OnClose(uv_handle_t *handle) { delete handle; } }; #endif
#include <iostream> #include <iomanip> #include <fstream> #include <string> using namespace std; ifstream myfile("infile-12.txt"); class Student { private: string fname; // first name of student string lname; // last name of student int G1, G2, G3, G4, G5, G6, G7; // grades for labs 1-7 int total; public: string Constructor = "Construtor works\n"; string Deconstructor = "Deconstructor works \n"; Student(); Student(string); ~Student(); // deconstructor void computeGrade(); // computes student grade void getGrade(); }; int main () { // Declare students Student stu1; Student stu2; Student stu3; Student stu4; // Grades for Students 1 stu1.getGrade(); stu1.computeGrade(); // Grades for Students 2 stu2.getGrade(); stu2.computeGrade(); // Grades for Students 3 stu3.getGrade(); stu3.computeGrade(); // Grades for Students 4 stu4.getGrade(); stu4.computeGrade(); return 0; } // Constructor Student::Student() { G1 = 0; G2 = 0; G3 = 0; G4 = 0; G5 = 0; G6 = 0; G7 = 0; fname = "null"; lname = "null"; } Student::Student(string Constructor) { cout << Constructor; } Student::~Student() { cout << Deconstructor; } void Student::getGrade() { myfile >> fname >> lname >> G1 >> G2 >> G3 >> G4 >> G5 >> G6 >> G7; // Header cout << "STUDENT: " << fname << " " << lname << endl; // Display student grades cout << "Lab Grades: " << G1 << " " << G2 << " " << G3 << " " << G4 << " " << G5 << " " << G6 << " " << G7 << endl; } void Student::computeGrade() { int total; float gradeAverage; for(int index = 0; index < 4; index++) for(int index = 0; index < 7; index++) { total = G1 + G2 + G3 + G4 + G5 + G6 + G7; gradeAverage = float(total)/7; // divide all grades by 7 } cout << fixed << showpoint << setprecision(2); cout << "Total Grade for " << fname << ": " << total << endl; cout << "Grade Average for " << fname << ": " << gradeAverage << endl; cout << endl; }
/*! * @author Evan Driscoll */ #include "wali/witness/CalculatingVisitor.hpp" template class wali::witness::CalculatingVisitor<int>;
#include "Tool_Kalman.h" /** * @brief 构造一个新的卡尔曼滤波器实例 * 构造完成后,必须按照物理模型手动给 A、B、H 赋值 * * @param stateDim 状态空间维度,即你整个卡尔曼滤波器会接触到多少种物理量。 * 这些物理量之间必须是线性的,就是说他们之间的关系只有加减乘除、积分、微分 * 例如 位置-速度-加速度 的状态空间,就有3个维度 * * @param measureDim 测量矩阵维度,即有多少个传感器 * 例如你有 绝对码盘(角度)-相对码盘(角速度)-陀螺仪(角加速度),就有3个维度 * * @param controlDim 控制矩阵维度,即有多少个控制量可以用进去做预测。 * 可以填0。一般也只有1个,就是你发给电调的电流,它与加速度有关 * * @param processErr 过程噪声 * 整个环境中有多少不可控因素,比如向前运动突然撞车,就是一种过程噪声。 * 数字越大,噪声越大。 * * @param measureErr 测量噪声 * 传感器引入的噪声。也就是传感器精度。 * 数字越大,噪声越大。 */ KalmanFilter::KalmanFilter(uint16_t stateDim, uint16_t measureDim, uint16_t controlDim, float32_t processErr, float32_t measureErr) { xhat = Mat::zeros(stateDim, 1); xhatminus = Mat::zeros(stateDim, 1); A = Mat::eye(stateDim, stateDim); Q = Mat::eye(stateDim, stateDim, processErr); H = Mat::zeros(measureDim, stateDim); R = Mat::eye(measureDim, measureDim, measureErr); // 默认构造假定初始状态不可知,故给予极大的协方差矩阵 P = Mat::eye(stateDim, stateDim, 1e7); Pminus = Mat::zeros(stateDim, stateDim); K = Mat::zeros(stateDim, measureDim); if(controlDim > 0) B = Mat::zeros(stateDim, controlDim); u = Mat::zeros(controlDim, 1); z = Mat::zeros(measureDim, 1); HT = H.trans(); AT = A.trans(); } /** * @brief 初始化卡尔曼滤波器 * 如果你知道初始状态,可以输入给滤波器。否则你可不必调用此函数。 * @param state 数组,代表各个状态量 * @param error 一个数字,代表状态量的可信度。可信度越高,数字越小。 */ void KalmanFilter::init(float32_t* state, float32_t error) { xhat.pData = state; P = Mat::eye(P.numRows, P.numCols, error); } float32_t* KalmanFilter::predict(float32_t* control) { u.pData = control; //1. 预测状态 xhatminus = A * xhat; if (control && B.numRows!=0 && B.numCols!=0) xhatminus = xhatminus + B * u; //2. 预测误差协方差 Pminus = A * P * AT + Q; return xhatminus.pData; } float32_t* KalmanFilter::correct(float32_t* measurement) { z.pData = measurement; //3. 计算卡尔曼增益 K = H * Pminus * HT + R; P = K.inverse(); K = Pminus * HT * P; //4. 用测量值更新估计 xhat = xhatminus + K * (z - H * xhatminus); //5. 更新误差协方差 P = (Q - K * H) * Pminus; return xhat.pData; };
#include <iostream> #include <queue> #include <deque> #include <algorithm> #include <string> #include <vector> #include <stack> #include <set> #include <map> #include <math.h> #include <string.h> #include <bitset> #include <cmath> using namespace std; vector<int> getPartialMatch(const string &N) { int m = N.size(); vector<int> pi(m, 0); int begin = 1, matched = 0; while (begin + matched < m) { if (N[begin + matched] == N[matched]) { matched++; pi[begin + matched - 1] = matched; } else { if (matched == 0) begin++; else { begin += matched - pi[matched - 1]; matched = pi[matched - 1]; } } } return pi; } vector<int> kmpSearch(const string &H, const string &N) { int n = H.size(), m = N.size(); vector<int> ret; vector<int> pi = getPartialMatch(N); int matched = 0; for (int i = 0; i < n; i++) { while (matched > 0 && H[i] != N[matched]) matched = pi[matched - 1]; if (H[i] == N[matched]) { matched++; if (matched == m) { ret.push_back(i - m + 1); matched = pi[matched - 1]; } } } return ret; } int main() { ios::sync_with_stdio(false); cin.tie(0); string h, n; getline(cin, h); getline(cin, n); vector<int> ret = kmpSearch(h, n); cout << ret.size() << "\n"; for (auto x : ret) cout << x + 1 << " "; return 0; }
void rc(){ //Serial.begin(9600); ch1 = pulseIn(ip1, HIGH); //THRUSTER if (ch1 > 1550) { val1=map(ch1, 1550, 1900, 1550, 1900); thruster1.writeMicroseconds(val1); thruster2.writeMicroseconds(val1); delay(100); } else if (ch1 < 1450) { val1=map(ch1, 1450, 1100, 1450, 1300); thruster1.writeMicroseconds(val1); thruster2.writeMicroseconds(val1); delay(100); } else if (1450< ch1 <1550) { thruster1.writeMicroseconds(1500); thruster2.writeMicroseconds(1500); delay(100); } ch2 = pulseIn(ip2, HIGH); // SERVO if (1100<ch2<1900) { val2 = map(ch2, 1900, 1100, 95-14, 95+14); //중앙값 93 +- 13 servo1.write(val2); servo2.write(val2 - 2); // 1번(왼) 2번(오) 차이 값 작아지는게 우회전 delay(100); } /* if (1100< ch2 < 1450) { val2 = map(ch2, 1450, 1000, 94, 70); servo1.write(val2); servo2.write(val2 - 2); delay(100); } else if ( 1450< ch2 < 1550) { servo1.write(94); servo2.write(92); delay(100); } else if ( 1550< ch2 <1900) { val2 = map(ch2, 1900, 1550, 118, 94); servo1.write(val2); servo2.write(val2-2); delay(100); }*/ ch6 = pulseIn(ip6,HIGH); //RELAY { if (ch6 < 1450) { digitalWrite(relaypin,LOW); delay(100); } else if (ch6 > 1450) { digitalWrite(relaypin,HIGH); delay(100); } } }
#include "TestFramework.h" #include "treeface/misc/PropertyValidator.h" #include <treecore/Array.h> #include <treecore/RefCountHolder.h> #include <treecore/Identifier.h> #include <treecore/NamedValueSet.h> #include <treecore/RefCountObject.h> #include <treecore/String.h> #include <treecore/Variant.h> using namespace treeface; using namespace treecore; void TestFramework::content() { PropertyValidator validator; validator.add_item("prop1", PropertyValidator::ITEM_SCALAR, true); validator.add_item("prop2", PropertyValidator::ITEM_SCALAR, false); { NamedValueSet kv1; kv1.set(Identifier("prop1"), var("value")); OK(validator.validate(kv1)); } { NamedValueSet kv2; kv2.set(Identifier("prop1"), var("value")); kv2.set(Identifier("prop2"), var("another value")); OK(validator.validate(kv2)); } { NamedValueSet kv3; kv3.set(Identifier("prop1"), var("value")); kv3.set(Identifier("prop_not_wanted"), var("foobarbaz")); OK(!validator.validate(kv3)); } { Array<var> AV; NamedValueSet kv4; kv4.set(Identifier("prop1"), var("value")); kv4.set(Identifier("prop2"), var(AV)); OK(!validator.validate(kv4)); } { treecore::RefCountHolder<RefCountObject> obj = new RefCountObject(); NamedValueSet kv5; kv5.set(Identifier("prop1"), var(obj.get())); kv5.set(Identifier("prop2"), var("aaaaaaa")); OK(!validator.validate(kv5)); } }
const int MOD=1e9+7; struct mint{ int x; mint():x(0){} mint(int s){ x=s;if(x<MOD && x>=0)return; x%=MOD;if(x<0)x+=MOD; } mint(ll s){int ts=s%MOD;if(ts<0)ts+=MOD;x=ts;} mint& operator+=(mint t){ if( (x+=t.x) >=MOD)x-=MOD;return *this;} mint& operator-=(mint t){ if( (x+=MOD-t.x) >=MOD)x-=MOD;return *this;} mint& operator*=(mint t){x=(ll)x*t.x%MOD;return *this;} mint& operator/=(mint t){return *this*=t.inv();} mint operator-()const{if(x)return MOD-x;return 0;} mint operator+(mint t)const{return mint(*this)+=t;} mint operator-(mint t)const{return mint(*this)-=t;} mint operator*(mint t)const{return mint(*this)*=t;} mint operator/(mint t)const{return mint(*this)/=t;} mint pow(ll k)const{ mint r=1,a=x; for(;k;k>>=1,a*=a) if(k&1) r*=a; return r; } mint inv()const{return mint(x).pow(MOD-2);} };
// Created by: Kirill GAVRILOV // Copyright (c) 2013-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef NCollection_Vec2_HeaderFile #define NCollection_Vec2_HeaderFile #include <cmath> // std::sqrt() #include <Standard_Dump.hxx> //! Auxiliary macros to define couple of similar access components as vector methods. //! @return 2 components by their names in specified order #define NCOLLECTION_VEC_COMPONENTS_2D(theX, theY) \ const NCollection_Vec2<Element_t> theX##theY() const { return NCollection_Vec2<Element_t>(theX(), theY()); } \ const NCollection_Vec2<Element_t> theY##theX() const { return NCollection_Vec2<Element_t>(theY(), theX()); } //! Defines the 2D-vector template. //! The main target for this class - to handle raw low-level arrays (from/to graphic driver etc.). template<typename Element_t> class NCollection_Vec2 { public: //! Returns the number of components. static int Length() { return 2; } //! Empty constructor. Construct the zero vector. NCollection_Vec2() { v[0] = v[1] = Element_t(0); } //! Initialize ALL components of vector within specified value. explicit NCollection_Vec2 (const Element_t theXY) { v[0] = v[1] = theXY; } //! Per-component constructor. explicit NCollection_Vec2 (const Element_t theX, const Element_t theY) { v[0] = theX; v[1] = theY; } //! Conversion constructor (explicitly converts some 2-component vector with other element type //! to a new 2-component vector with the element type Element_t, //! whose elements are static_cast'ed corresponding elements of theOtherVec2 vector) //! @tparam OtherElement_t the element type of the other 2-component vector theOtherVec2 //! @param theOtherVec2 the 2-component vector that needs to be converted template <typename OtherElement_t> explicit NCollection_Vec2 (const NCollection_Vec2<OtherElement_t>& theOtherVec2) { v[0] = static_cast<Element_t> (theOtherVec2[0]); v[1] = static_cast<Element_t> (theOtherVec2[1]); } //! Assign new values to the vector. void SetValues (const Element_t theX, const Element_t theY) { v[0] = theX; v[1] = theY; } //! Alias to 1st component as X coordinate in XY. Element_t x() const { return v[0]; } //! Alias to 2nd component as Y coordinate in XY. Element_t y() const { return v[1]; } //! @return 2 components by their names in specified order (in GLSL-style) NCOLLECTION_VEC_COMPONENTS_2D(x, y) //! Alias to 1st component as X coordinate in XY. Element_t& x() { return v[0]; } //! Alias to 2nd component as Y coordinate in XY. Element_t& y() { return v[1]; } //! Check this vector with another vector for equality (without tolerance!). bool IsEqual (const NCollection_Vec2& theOther) const { return v[0] == theOther.v[0] && v[1] == theOther.v[1]; } //! Check this vector with another vector for equality (without tolerance!). bool operator== (const NCollection_Vec2& theOther) const { return IsEqual (theOther); } //! Check this vector with another vector for non-equality (without tolerance!). bool operator!= (const NCollection_Vec2& theOther) const { return !IsEqual (theOther); } //! Raw access to the data (for OpenGL exchange). const Element_t* GetData() const { return v; } Element_t* ChangeData() { return v; } operator const Element_t*() const { return v; } operator Element_t*() { return v; } //! Compute per-component summary. NCollection_Vec2& operator+= (const NCollection_Vec2& theAdd) { v[0] += theAdd.v[0]; v[1] += theAdd.v[1]; return *this; } //! Compute per-component summary. friend NCollection_Vec2 operator+ (const NCollection_Vec2& theLeft, const NCollection_Vec2& theRight) { return NCollection_Vec2 (theLeft.v[0] + theRight.v[0], theLeft.v[1] + theRight.v[1]); } //! Compute per-component subtraction. NCollection_Vec2& operator-= (const NCollection_Vec2& theDec) { v[0] -= theDec.v[0]; v[1] -= theDec.v[1]; return *this; } //! Compute per-component subtraction. friend NCollection_Vec2 operator- (const NCollection_Vec2& theLeft, const NCollection_Vec2& theRight) { return NCollection_Vec2 (theLeft.v[0] - theRight.v[0], theLeft.v[1] - theRight.v[1]); } //! Unary -. NCollection_Vec2 operator-() const { return NCollection_Vec2 (-x(), -y()); } //! Compute per-component multiplication. NCollection_Vec2& operator*= (const NCollection_Vec2& theRight) { v[0] *= theRight.v[0]; v[1] *= theRight.v[1]; return *this; } //! Compute per-component multiplication. friend NCollection_Vec2 operator* (const NCollection_Vec2& theLeft, const NCollection_Vec2& theRight) { return NCollection_Vec2 (theLeft.v[0] * theRight.v[0], theLeft.v[1] * theRight.v[1]); } //! Compute per-component multiplication by scale factor. void Multiply (const Element_t theFactor) { v[0] *= theFactor; v[1] *= theFactor; } //! Compute per-component multiplication by scale factor. NCollection_Vec2 Multiplied (const Element_t theFactor) const { return NCollection_Vec2 (v[0] * theFactor, v[1] * theFactor); } //! Compute component-wise minimum of two vectors. NCollection_Vec2 cwiseMin (const NCollection_Vec2& theVec) const { return NCollection_Vec2 (v[0] < theVec.v[0] ? v[0] : theVec.v[0], v[1] < theVec.v[1] ? v[1] : theVec.v[1]); } //! Compute component-wise maximum of two vectors. NCollection_Vec2 cwiseMax (const NCollection_Vec2& theVec) const { return NCollection_Vec2 (v[0] > theVec.v[0] ? v[0] : theVec.v[0], v[1] > theVec.v[1] ? v[1] : theVec.v[1]); } //! Compute component-wise modulus of the vector. NCollection_Vec2 cwiseAbs() const { return NCollection_Vec2 (std::abs (v[0]), std::abs (v[1])); } //! Compute maximum component of the vector. Element_t maxComp() const { return v[0] > v[1] ? v[0] : v[1]; } //! Compute minimum component of the vector. Element_t minComp() const { return v[0] < v[1] ? v[0] : v[1]; } //! Compute per-component multiplication by scale factor. NCollection_Vec2& operator*= (const Element_t theFactor) { Multiply (theFactor); return *this; } //! Compute per-component division by scale factor. NCollection_Vec2& operator/= (const Element_t theInvFactor) { v[0] /= theInvFactor; v[1] /= theInvFactor; return *this; } //! Compute per-component division. NCollection_Vec2& operator/= (const NCollection_Vec2& theRight) { v[0] /= theRight.v[0]; v[1] /= theRight.v[1]; return *this; } //! Compute per-component multiplication by scale factor. NCollection_Vec2 operator* (const Element_t theFactor) const { return Multiplied (theFactor); } //! Compute per-component division by scale factor. NCollection_Vec2 operator/ (const Element_t theInvFactor) const { return NCollection_Vec2(v[0] / theInvFactor, v[1] / theInvFactor); } //! Compute per-component division. friend NCollection_Vec2 operator/ (const NCollection_Vec2& theLeft, const NCollection_Vec2& theRight) { return NCollection_Vec2 (theLeft.v[0] / theRight.v[0], theLeft.v[1] / theRight.v[1]); } //! Computes the dot product. Element_t Dot (const NCollection_Vec2& theOther) const { return x() * theOther.x() + y() * theOther.y(); } //! Computes the vector modulus (magnitude, length). Element_t Modulus() const { return std::sqrt (x() * x() + y() * y()); } //! Computes the square of vector modulus (magnitude, length). //! This method may be used for performance tricks. Element_t SquareModulus() const { return x() * x() + y() * y(); } //! Construct DX unit vector. static NCollection_Vec2 DX() { return NCollection_Vec2 (Element_t(1), Element_t(0)); } //! Construct DY unit vector. static NCollection_Vec2 DY() { return NCollection_Vec2 (Element_t(0), Element_t(1)); } //! Dumps the content of me into the stream void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const { (void)theDepth; OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Vec2", 2, v[0], v[1]) } private: Element_t v[2]; }; #endif // _NCollection_Vec2_H__
#include <ionir/construct/inst_yield.h> namespace ionir { InstYield::InstYield(std::string yieldId) : yieldId(std::move(yieldId)) { // } }
#ifndef UTL_MATH_H #define UTL_MATH_H #include "utl/base.h" #include <cmath> namespace utl { namespace imp { inline constexpr double pi = 3.14159265358979323846; // M_PI isn't always defined } /** * @brief Convert decimal degrees to radians. * * @param deg Decimal degrees * @return Radians */ constexpr double radians(double deg) { return deg * imp::pi / 180.0; } /** * @brief Convert radians to decimal degrees. * * @param rad Radians * @return Decimal degrees */ constexpr double degrees(double rad) { return rad * 180.0 / imp::pi; } /** * @brief Unsigned integer division with round up. * * @tparam T Unsigned integer type * @param dividend Unsigned * @param divisor Unsigned, can be 0 * @return Quotient */ template<class T> constexpr T uceil(T dividend, T divisor) { return divisor ? (dividend + (divisor - 1)) / divisor : 0; } /** * @brief Map integer from one range to another. Input range * difference shouldn't be zero. * * @tparam T Integer type * @param val Input value * @param in_min Input minimum * @param in_max Input maximum * @param out_min Output range minimum * @param out_max Output range maximum * @return Result */ template<class T> constexpr T imap(T val, T in_min, T in_max, T out_min, T out_max) { double slope = 1.0 * (out_max - out_min) / (in_max - in_min); return out_min + slope * (val - in_min); } /** * @brief Integer power function. * * @tparam T Integer type * @param b Base * @param e Exponent * @return 'base' to the power 'exp' */ template<class T> constexpr T ipow(T b, unsigned e) { T r = 1; while (e) { if (e & 1) r *= b; b *= b; e >>= 1; } return r; } /** * @brief Get integer length in symbols for a given base, e.g. * 0 --> 1, 10 --> 2, 100 --> 3, -777 --> 4. * * @tparam T Integer type * @param x Integer value * @param b Base * @return Length */ template<class T> constexpr size_t ilen(T x, int b = 10) { size_t l = !x + (x < 0); for (auto v = x; v; v /= b, ++l); return l; } /** * @brief Get floating number length in symbols for given precision. * * @param x Floating value * @param p Precision * @return Length */ constexpr size_t flen(std::floating_point auto x, int p = 5) { auto whole = static_cast<long long>(x); // x -= whole; auto len = ilen(whole); // x *= ipow(); // for (int i = 0; i < p; ++i) // x *= 10; return len + 1 + p; // ilen(static_cast<long long>(x)); // +1 for dot } /** * @brief Factorial, negative input leads to undefined behavior. * * @tparam T Integer type * @param x Argument * @return Result */ template<class T> constexpr T fact(T x) { T res = 1; for (T i = 2; i <= x; ++i) res *= i; return res; } /** * @brief Galois 2^8 field multiplication using Russian * Peasant Multiplication algorithm. * * @param x Multiplicand * @param y Multiplier * @return Product */ constexpr uint8_t gf_mul(uint8_t x, uint8_t y) { uint8_t r = 0; while (y) { if (y & 1) r ^= x; x = (x << 1) ^ ((x >> 7) * 0x11d); y >>= 1; } return r; } /** * @brief Calculate distance in meters on a sphere surface between * two decimal degree points. * * @param lat_1 Latitude of first point * @param lng_1 Longitude of first point * @param lat_2 Latitude of second point * @param lng_2 Longitude of second point * @param radius Sphere radius in meters * @return Distance in meters */ inline double haversine(double lat_1, double lng_1, double lat_2, double lng_2, double radius) { double a = pow(sin(radians(lat_2 - lat_1) / 2), 2) + pow(sin(radians(lng_2 - lng_1) / 2), 2) * cos(radians(lat_1)) * cos(radians(lat_2)); double c = 2 * asin(sqrt(a)); return c * radius; } /** * @brief Calculate distance in meters on Earth between two * decimal degree points in geographic coordinate system. * * @param lat_1 Latitude of first point * @param lng_1 Longitude of first point * @param lat_2 Latitude of second point * @param lng_2 Longitude of second point * @return Distance in meters */ inline double gcs_distance(double lat_1, double lng_1, double lat_2, double lng_2) { return haversine(lat_1, lng_1, lat_2, lng_2, 6371000); } /** * @brief Calculate tilt using accelerometer data. * * @param x Axis X acceleration * @param y Axis Y acceleration * @param z Axis Z acceleration * @return Inclination angle in degrees */ inline double inclination(double x, double y, double z) { return degrees(acos(z / sqrt(x * x + y * y + z * z))); } /** * @brief Calculate Rxyz roll using accelerometer data. * * @param y Axis Y acceleration * @param z Axis Z acceleration * @return Roll angle in degrees */ inline double roll(double y, double z) { return degrees(atan2(y, z)); } /** * @brief Calculate Rxyz pitch using accelerometer data. * * @param x Axis X acceleration * @param y Axis Y acceleration * @param z Axis Z acceleration * @return Pitch angle in degrees */ inline double pitch(double x, double y, double z) { return degrees(atan2(-x, sqrt(y * y + z * z))); } namespace literals { constexpr auto operator"" _rad(long double deg) { return radians(deg); } constexpr auto operator"" _deg(long double rad) { return degrees(rad); } } } #endif
#include "keyframeselection.h" #include "ui_keyframeselection.h" #include <iostream> #include <string> #include <QFileDialog> #include "MatToQImage.h" #include <QGraphicsDropShadowEffect> KeyFrameSelection::KeyFrameSelection(QWidget *parent) : QWidget(parent), ui(new Ui::KeyFrameSelection) { std::cout << "Inicializando KFSelection..." << std::endl; ui->setupUi(this); ui->video_slider->setDisabled(true); ui->select_keyframe->setDisabled(true); connect(ui->video_slider,SIGNAL(valueChanged(int)),this,SLOT(actualizar_frame())); // Sombras QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(); shadow->setBlurRadius(40); shadow->setXOffset(10); shadow->setYOffset(10); shadow->setColor(QColor(0, 0, 0, 130)); ui->img_label->setGraphicsEffect(shadow); QGraphicsDropShadowEffect *shadow_open = new QGraphicsDropShadowEffect(); shadow_open->setBlurRadius(20); shadow_open->setXOffset(0); shadow_open->setYOffset(0); shadow_open->setColor(QColor(0, 0, 0, 100)); ui->open_video->setGraphicsEffect(shadow_open); QGraphicsDropShadowEffect *shadow_convertir = new QGraphicsDropShadowEffect(); shadow_convertir->setBlurRadius(20); shadow_convertir->setXOffset(0); shadow_convertir->setYOffset(0); shadow_convertir->setColor(QColor(0, 0, 0, 200)); ui->convertir->setGraphicsEffect(shadow_convertir); QGraphicsDropShadowEffect *shadow_select = new QGraphicsDropShadowEffect(); shadow_select->setBlurRadius(20); shadow_select->setXOffset(0); shadow_select->setYOffset(0); shadow_select->setColor(QColor(0, 0, 0, 200)); ui->select_keyframe->setGraphicsEffect(shadow_select); QSizePolicy img_size; img_size.setHorizontalPolicy(QSizePolicy::Minimum); img_size.setVerticalPolicy(QSizePolicy::Minimum); ui->img_label->setSizePolicy(img_size); std::cout << "KFSelection inicializado." << std::endl; } KeyFrameSelection::~KeyFrameSelection() { delete ui; } void KeyFrameSelection::actualizar_frame() { int frame_number = ui->video_slider->value(); if (frame_number < cap.get(cv::CAP_PROP_FRAME_COUNT)-1) { cap.set(cv::CAP_PROP_POS_FRAMES,frame_number - 1); cap.read(frame); ui->txt_frame_actual->setText(QString::number(frame_number)); } frame = GetFittedImage(frame,563,1000); //QImage imgQ = MatToQImage(GetFittedImage(frame,ui->img_label->height(),ui->img_label->width())); QImage imgQ = MatToQImage(frame); ui->img_label->setPixmap(QPixmap::fromImage(imgQ).scaled(ui->img_label->width(), ui->img_label->width()*0.5625)); } void KeyFrameSelection::resizeEvent(QResizeEvent *event){ if(cap.isOpened()){ ui->img_label->setMinimumHeight(int(ui->img_label->width()*0.5625) ); QImage imgQ = MatToQImage(frame); ui->img_label->setPixmap(QPixmap::fromImage(imgQ).scaled(ui->img_label->width(), ui->img_label->width()*0.5625)); } } void KeyFrameSelection::on_open_video_clicked() { QString shape_dir; QString fileName = QFileDialog::getOpenFileName(this, tr("Abrir Video"), shape_dir, tr("Video Files (*.avi *.mp4 *.mov *.mkv)")); if(fileName == NULL) return; std::cout << "Se cargara el archivo de video: " << fileName.toUtf8().constData() << std::endl; // Cargar video cap.open(fileName.toStdString()); if (!cap.isOpened()) { int ret = QMessageBox::critical(this, tr("Error abriendo el video."), tr("Archivo corrupto o formato \n" "de video no aceptado."), QMessageBox::Ok); ui->video_slider->setDisabled(true); return; } else{ ui->video_slider->setDisabled(false); ui->select_keyframe->setDisabled(false); int totalframes = cap.get(cv::CAP_PROP_FRAME_COUNT); //std::cout << "Total Frames: " << totalframes << std::endl; //std::cout << cap.get(cv::CAP_PROP_FOURCC) << std::endl; ui->video_slider->setRange(0,totalframes); ui->txt_frame_max->setText(QString::number(totalframes)); } cap.set(cv::CAP_PROP_POS_FRAMES,0); cap.read(frame); ui->img_label->setMinimumHeight(int(ui->img_label->width()*0.5625) ); frame = GetFittedImage(frame,563,1000); QImage imgQ = MatToQImage(frame); ui->img_label->setPixmap(QPixmap::fromImage(imgQ).scaled(ui->img_label->width(),ui->img_label->height())); filename = fileName.toStdString(); } void KeyFrameSelection::on_convertir_clicked() { QString shape_dir; QString fileName = QFileDialog::getOpenFileName(this, tr("Abrir Video"), shape_dir, tr("Video Files (*.mp4 *.mov *.mkv)")); if(fileName == NULL) return; // Cargar video cap.open(fileName.toStdString()); if (!cap.isOpened()) { int ret = QMessageBox::critical(this, tr("Error abriendo el video."), tr("Archivo corrupto o formato \n" "de video no aceptado."), QMessageBox::Ok); ui->video_slider->setDisabled(true); return; } else{ std::cout << "Se convertira el archivo de video: " << fileName.toUtf8().constData() << std::endl; int ex = static_cast<int>(cap.get(cv::CAP_PROP_FOURCC)); char aux; aux = ex & 0XFF; std::cout << aux << std::endl; aux = (ex & 0XFF00) >> 8; std::cout << aux << std::endl; aux = (ex & 0XFF0000) >> 16; std::cout << aux << std::endl; aux = (ex & 0XFF000000) >> 24; std::cout << aux << std::endl; QFileInfo info(fileName); QString data_dir = info.absolutePath(); std::cout << "Se va a hacer el remplazo de nombre" << std::endl; std::string out = fileName.toStdString().substr(0,fileName.toStdString().find_last_of(".")) + std::string(".avi"); std::cout << out << std::endl; cv::VideoWriter video(out ,cv::VideoWriter::fourcc('M','J','P','G'),cap.get(cv::CAP_PROP_FPS), cv::Size(cap.get(cv::CAP_PROP_FRAME_WIDTH),cap.get(cv::CAP_PROP_FRAME_HEIGHT))); cv::Mat out_frame; while(cap.read(out_frame)) { cv::flip(out_frame, out_frame, 0); video.write(out_frame); } video.release(); cap.release(); std::cout << "Video Convertido." << std::endl; } } void KeyFrameSelection::on_select_keyframe_clicked() { frame = GetFittedImage(frame, 563,1000); emit keyframe_selected(); //cap.release(); }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Lars Thomas Hansen */ #ifndef OP_BITVECTOR_H #define OP_BITVECTOR_H /** A bitvector holds single-bit values from 0 to INT_MAX. We represent it as a linear array of bits up to the highest bit set. Watch it! */ class OpBitvector { public: OpBitvector(); ~OpBitvector(); /** Get bit at position n */ int GetBit(int n); /** Set bit at position n to 0 or 1 */ OP_STATUS SetBit(int n, int v); /** Set bits at positions first through last to 0 or 1 */ OP_STATUS SetBits(int first, int last, int v); private: /* Grow the data structure to allow n to be non-zero*/ OP_STATUS Grow(int n); int high; // highest+1 index represented by map UINT32 *map; // pointer to heap-allocated data }; inline int OpBitvector::GetBit(int n) { if (n >= high) return 0; else return (map[n >> 5] >> (n & 31)) & 1; } /* Observe that v is often known at compile-time, so when inlined this function will generally be much smaller. */ inline OP_STATUS OpBitvector::SetBit(int n, int v) { if (v == 0) if (n >= high) return OpStatus::OK; else map[n >> 5] &= ~(1 << (n & 31)); else { if (n >= high) { if (OpStatus::IsError(Grow(n))) return OpStatus::ERR_NO_MEMORY; } map[n >> 5] |= (1 << (n & 31)); } return OpStatus::OK; } #endif // OP_BITVECTOR_H
/* 2015年12月9日21:45:04 #1037 : 数字三角形 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 问题描述 小Hi和小Ho在经历了螃蟹先生的任务之后被奖励了一次出国旅游的机会,于是他们来到了大洋彼岸的美国。美国人民的生活非常有意思,经常会有形形色色、奇奇怪怪的活动举办,这不,小Hi和小Ho刚刚下飞机,就赶上了当地的迷宫节活动。迷宫节里展览出来的迷宫都特别的有意思,但是小Ho却相中了一个其实并不怎么像迷宫的迷宫——因为这个迷宫的奖励非常丰富~ 于是小Ho找到了小Hi,让小Hi帮助他获取尽可能多的奖品,小Hi把手一伸道:“迷宫的介绍拿来!” 小Ho选择的迷宫是一个被称为“数字三角形”的n(n不超过200)层迷宫,这个迷宫的第i层有i个房间,分别编号为1..i。除去最后一层的房间,每一个房间都会有一些通往下一层的房间的楼梯,用符号来表示的话,就是从第i层的编号为j的房间出发会有两条路,一条通向第i+1层的编号为j的房间,另一条会通向第i+1层的编号为j+1的房间,而最后一层的所有房间都只有一条离开迷宫的道路。这样的道路都是单向的,也就是说当沿着这些道路前往下一层的房间或者离开迷宫之后,小Ho没有办法再次回到这个房间。迷宫里同时只会有一个参与者,而在每个参与者进入这个迷宫的时候,每个房间里都会生成一定数量的奖券,这些奖券可以在通过迷宫之后兑换各种奖品。小Ho的起点在第1层的编号为1的房间,现在小Ho悄悄向其他参与者弄清楚了每个房间里的奖券数量,希望小Hi帮他计算出他最多能获得多少奖券。 提示一:盲目贪心不可取,搜索计算太耗时 提示二:记忆深搜逞神威,宽度优先解难题 提示三:总结归纳提公式,减少冗余是真理 输入 每个测试点(输入文件)有且仅有一组测试数据。 每组测试数据的第一行为一个正整数n,表示这个迷宫的层数。 接下来的n行描述这个迷宫中每个房间的奖券数,其中第i行的第j个数代表着迷宫第i层的编号为j的房间中的奖券数量。 测试数据保证,有100%的数据满足n不超过100 对于100%的数据,迷宫的层数n不超过100 对于100%的数据,每个房间中的奖券数不超过1000 对于50%的数据,迷宫的层数不超过15(小Ho表示2^15才3万多呢,也就是说……) 对于10%的数据,迷宫的层数不超过1(小Hi很好奇你的边界情况处理的如何?~) 对于10%的数据,迷宫的构造满足:对于90%以上的结点,左边道路通向的房间中的奖券数比右边道路通向的房间中的奖券数要多。 对于10%的数据,迷宫的构造满足:对于90%以上的结点,左边道路通向的房间中的奖券数比右边道路通向的房间中的奖券数要少。 输出 对于每组测试数据,输出一个整数Ans,表示小Ho可以获得的最多奖券数。 样例输入 5 2 6 4 1 2 8 4 0 9 6 6 5 5 3 6 样例输出 28 */ #include <stdio.h> #include <string.h> #include <iostream> using std::cout; using std::endl; int maze[110][110] = { 0 }; int main() { freopen("F:\\DocCenter\\ProjectFile\\c++\\vs2013\\hihocoder\\test.txt", "r", stdin); int n; scanf("%d", &n); for (int i = 1; i <= n; ++ i) { for (int j = 1; j <= i; ++ j) { scanf("%d", &maze[i][j]); } } for (int i = n - 1; i >= 1; -- i) { for (int j = 1; j <= i; ++ j) { if (maze[i + 1][j] > maze[i + 1][j + 1]) { maze[i][j] += maze[i + 1][j]; } else { maze[i][j] += maze[i + 1][j + 1]; } } } cout << maze[1][1] << endl; return 0; }
// Erich Dingeldein #include <iostream> #include <fstream> #include <queue> #include <thread> #include <unistd.h> #include <semaphore.h> #include <fcntl.h> #include <sys/stat.h> const char* filenames[] = { "./output1.txt", "./output2.txt", "./output3.txt" }; const char* output_filename = "./output4.txt"; const char* mutexnames[] = { "/out1mutex", "/out2mutex", "/out3mutex" }; void read_process(const char*, const char*); void read_file(const char*, char*); void write_process(const char*); std::queue<char> write_queue; std::thread read_threads[3]; std::thread write_thread; int run_process = 1; // 0 == stop process, 1 == run process int main(int argc, char** argv) { std::cout << "Press 'q' to exit consumer program..." << std::endl; for(int i = 0; i < 3; i++) read_threads[i] = std::thread(read_process, filenames[i], mutexnames[i]); write_thread = std::thread(write_process, output_filename); char in; do { std::cin >> in; } while(in != 'q'); run_process = 0; for(int i = 0; i < 3; i++) read_threads[i].join(); write_thread.join(); return 0; } void read_process(const char* filename, const char* mutex_name) { sem_t *mutex = sem_open(mutex_name, O_CREAT); if(mutex == 0) { perror("sem_open"); exit(0); } char lastread = ' '; while(run_process) { sleep(0.5f); sem_wait(mutex); read_file(filename, &lastread); sem_post(mutex); } sem_close(mutex); } void write_process(const char* filename) { while(run_process) { while(!write_queue.empty()) { char to_write = write_queue.front(); write_queue.pop(); std::ofstream outfile(filename, std::ios_base::app); outfile << to_write << std::endl; outfile.close(); } } } void read_file(const char* filename, char *lastread) { char temp; std::ifstream infile(filename, std::ios_base::in); infile >> temp; if(temp == *lastread) return; std::cout << filename << ": " << temp << std::endl; write_queue.push(temp); *lastread = temp; } int uinput_thread() { }
#include <iostream> #include<string.h> using namespace std; int main() { int n,q; cin>>n; string strings[n]; for(int i=0;i<n;i++) { cin>>strings[i]; } cin>>q; string queries[q]; int result[q]; for(int i=0;i<q;i++) { cin>>queries[i]; result[i]=0; } //cout<<endl; for(int i=0;i<q;i++) { for(int j=0;j<n;j++) { if(queries[i]==strings[j]) { result[i]++; // cout<<strings[j]<<" "<<queries[i]<<" "<<result[i]<<endl; } } } for(int i=0;i<q;i++) { // cin>>queries[i]; cout<<result[i]<<endl ; } }
#include <iostream> #include <climits> using namespace std; typedef struct CircularQueue { int rear; int front; int size; int *arr; CircularQueue(int s) { front = rear = -1; size = s; arr = new int[s]; } void enQue(int); int deQue(); void displayQueue(); } Queue; void CircularQueue ::enQue(int x) { if ((front == 0 && rear == size - 1) || (rear == (front - 1) % (size - 1))) { cout << "Queue is full!"; return; } else if (front == -1) { front = rear = 0; arr[rear] = x; } else if (rear == size - 1 && front != 0) { rear = 0; arr[rear] = x; } else arr[++rear] = x; } int CircularQueue ::deQue() { if (front == -1) { cout << "Queue is empty."; return INT_MIN; } int data = arr[front]; arr[front] = -1; if (front == rear) front = rear = -1; else if (front == size - 1) front = 0; else front++; return data; } void CircularQueue ::displayQueue() { if (front == -1) { cout << "Queue is empty"; return; } cout << "Elements in the circular queue are : " << endl; if (rear >= front) for (int i = front; i <= rear; i++) cout << arr[i] << endl; else { for (int i = front; i < size; i++) cout << arr[i] << endl; for (int i = 0; i <= rear; i++) cout << arr[i] << endl; } } int main() { CircularQueue q(5); q.enQue(14); q.enQue(22); q.enQue(13); q.enQue(-6); q.displayQueue(); return 0; }
/* * Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com> * Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com> * Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com> * Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com> * Copyright (c) 2011 Guillaume Pinot <guillaume.pinot(a)tremplin-utc.net> * Copyright (c) 2011 Cédric Royer <cedroyer(a)gmail.com> * Copyright (c) 2011 Guillaume Turri <guillaume.turri(a)gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifndef MONTECARLOTREESEARCHALG_HH #define MONTECARLOTREESEARCHALG_HH /** Classe qui effectue la recherche. A partir de l'arbre de decision, elle effectue une descente suivant la formule magique en replissant au fur et a mesure la classe SpaceALG courante. Par le biais de cette derniere, elle va ensuite generer les fils de la feuille courante puis lancer sur ceux-ci des simulations et des recherches locales a partir de l'espace courant. L'information est finalement remonter pour effectuer la prochaine descente. */ #include "TreeALG.hh" #include "TreeSimpleImplALG.hh" class SolutionALG; class SpaceALG; class MonteCarloTreeSearchALG { public: typedef TreeALG< TreeSimpleImplALG<NodeContentALG> > Tree; MonteCarloTreeSearchALG(); ~MonteCarloTreeSearchALG(); void search(); void setpTree(Tree *); Tree * getpTree() const; void setpInitialSpace(SpaceALG *); private: SpaceALG * initNewSpace(); int performDescent(); Tree * pTree_m; SpaceALG * pInitialSpace_m; }; #endif
#include <iostream> #include <stdexcept> #include <cstdlib> #include <string.h> #include <cstdint> #include "logger.hpp" #include "application.hpp" #include "world/block.hpp" #include "world/world.hpp" #include "world/generators/generator_flat.cpp" int main(int argc, char *argv[]) { Application application; //if `-D VALIDATIONLAYERS` is present in compilation, then validation layers will be enabled as default #ifdef VALIDATIONLAYERS bool enableValidationLayers = true; #else bool enableValidationLayers = false; #endif //if `-D LOGMIN=VALUE` is present in compilation then the value will be used for default logmin #ifndef LOGMIN Logger::SetMinLog(Logger::INFO); #elif LOGMIN == 1 Logger::SetMinLog(Logger::FINER); #elif LOGMIN == 2 Logger::SetMinLog(Logger::FINE); #elif LOGMIN == 3 Logger::SetMinLog(Logger::INFO); #elif LOGMIN == 4 Logger::SetMinLog(Logger::WARN); #elif LOGMIN == 5 Logger::SetMinLog(Logger::ERROR); #elif LOGMIN == 6 Logger::SetMinLog(Logger::CRITICAL); #else Logger::SetMinLog(Logger::INFO); #endif //if `-D LOGMAX=VALUE` is present in compilation then the value will be used for default logmax #ifndef LOGMAX Logger::SetMaxLog(Logger::NONE); #elif LOGMAX == 1 Logger::SetMaxLog(Logger::FINER); #elif LOGMAX == 2 Logger::SetMaxLog(Logger::FINE); #elif LOGMAX == 3 Logger::SetMaxLog(Logger::INFO); #elif LOGMAX == 4 Logger::SetMaxLog(Logger::WARN); #elif LOGMAX == 5 Logger::SetMaxLog(Logger::ERROR); #elif LOGMAX == 6 Logger::SetMaxLog(Logger::CRITICAL); #else Logger::SetMaxLog(Logger::NONE); #endif //Check for runtime arguments //available arguments // --logmin [finer|fine|info|warn/warning|error|none] - will silence all logs below treshold // --logmax [finer|fine|info|warn/warning|error|none] - will silence all logs above treshold // --validation-layers - enable Vulkan Validation layers // --validation-layer-khronos - enable Khronos' Vulkan Validation layer for right API usage // --validation-layer-api-dump - enable Lunarg's Vulkan Validation layer for API dumping // --flatland - make the world flat if (argc > 0) { for (int x = 0; x < argc; x++) { std::string parg = argv[x]; if (parg.compare("--logmin") == 0) { const std::string sarg = argv[x + 1]; if (sarg.compare("finer") == 0) { Logger::SetMinLog(Logger::FINER); } else if (sarg.compare("fine") == 0) { Logger::SetMinLog(Logger::FINE); } else if (sarg.compare("info") == 0) { Logger::SetMinLog(Logger::INFO); } else if (sarg.compare("warn") == 0 || sarg.compare("warning") == 0) { Logger::SetMinLog(Logger::WARNING); } else if (sarg.compare("error") == 0) { Logger::SetMinLog(Logger::ERROR); } else if (sarg.compare("critical") == 0) { Logger::SetMinLog(Logger::CRITICAL); } else if (sarg.compare("none") == 0) { Logger::SetMinLog(Logger::NONE); } else { Logger::Warn("Ignoring unknown argument for --logmin: " + sarg); std::cout << "unknown"; } } else if (parg.compare("--logmax") == 0) { //parse the min std::string sarg = argv[x + 1]; if (sarg.compare("finer") == 0) { Logger::SetMaxLog(Logger::FINER); } else if (sarg.compare("fine") == 0) { Logger::SetMaxLog(Logger::FINE); } else if (sarg.compare("info") == 0) { Logger::SetMaxLog(Logger::INFO); } else if (sarg.compare("warn") == 0 || sarg.compare("warning") == 0) { Logger::SetMaxLog(Logger::WARNING); } else if (sarg.compare("error") == 0) { Logger::SetMaxLog(Logger::ERROR); } else if (sarg.compare("critical") == 0) { Logger::SetMaxLog(Logger::CRITICAL); } else if (sarg.compare("none") == 0) { Logger::SetMaxLog(Logger::NONE); } else { Logger::Warn("Ignoring unknown argument for --logmax: " + sarg); } } else if (parg.compare("--validation-layers") == 0) { enableValidationLayers = true; } else if (parg.compare("--validation-layer-khronos") == 0) { enableValidationLayers = true; application.validationLayers.push_back("VK_LAYER_KHRONOS_validation"); } else if (parg.compare("--validation-layer-api-dump") == 0) { enableValidationLayers = true; application.validationLayers.push_back("VK_LAYER_LUNARG_api_dump"); } else if(parg.compare("--flatland") == 0){ application.gameWorld.worldGenerator = new GeneratorFlat(); application.PlayerPosition = glm::vec3(0, -10, 0); } } } const std::string compDate = __DATE__; const std::string compTime = __TIME__; Logger::Fine("Compiled on " + compDate + " at " + compTime); #ifdef VALIDATIONLAYERS Logger::Fine("Compiled with Validation Layers enabled by default"); #endif #ifdef LAYERS_KHRONOS_VALIDATION application.validationLayers.push_back("VK_LAYER_KHRONOS_validation"); Logger::Fine("Compiled with Always On Validation Layer VK_LAYER_KHRONOS_validation"); #endif #ifdef LAYERS_API_DUMP application.validationLayers.push_back("VK_LAYER_LUNARG_api_dump"); Logger::Fine("Compiled with Always On Validation Layer VK_LAYER_LUNARG_api_dump"); #endif try { BlockInitialise(); application.run(enableValidationLayers); } catch (std::exception &e) { Logger::Critical(e.what()); return EXIT_FAILURE; } return EXIT_SUCCESS; }
#include <Memory.h> #include <PSException.h> #include <iostream> // TODO: dealing with multiple bytes might need improvement. this needs to be quick. // these also need to be carefully tested. casting etc /*** Memory Bus ***/ int memBus::find(unsigned address) { // search list for correct memory device for (unsigned i = 0; i < bus_list.size(); i++) { if ((address >= bus_list[i].address_start) && (address <= bus_list[i].address_end)) { return i; } } //TODO: pick proper exception throw adesException(); } // TODO: should these be subtracting address_start? word memBus::readWord(unsigned address) { // address is divided by 4 to get word granularity return bus_list[find(address)].memory_device->readWord(address / 4); } void memBus::writeWord(unsigned address, word in) { // address is divided by 4 to get word granularity bus_list[find(address)].memory_device->writeWord(address / 4, in); } /*** RAM ***/ void RAMImpl::writeWord(unsigned address, word in) { write(maskAddress(address), in); } word RAMImpl::readWord(unsigned address) { return read(maskAddress(address)); }
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: int maxProfit(vector<int>& prices) { //基本思想:动态规划,dp[i][0 or 1 or 2]表示第i天手上是否持有股票或冷冻期状态下的最大收益 //dp[i][0]表示第i天手中不持有股票状态下的最大收益 //dp[i][1]表示第i天手中持有股票状态下的最大收益 //dp[i][2]表示第i天冷冻期状态下的最大收益 if(prices.size()<2) return 0; //dp[i][0 or 1 or 2]表示第i天,手上是否持有股票或冷冻期状态下的最大收益 vector<vector<int>> dp(prices.size(), vector<int>(3, 0)); //初始化第0天状态值 dp[0][0]=0; dp[0][1]=-prices[0]; dp[0][2]=0; //遍历第1天之后的每天股票情况 for(int i=1;i<prices.size();i++) { //第i天手中没有股票下的最大收益等于max(1、前一天没有股票状态下的收益;2、前一天冷冻期状态下的收益) dp[i][0] = max(dp[i-1][0], dp[i-1][2]); //第i天手中有股票下的最大收益等于max(1、买入股票:前一天的没有股票下的最大收益-今天股票价格;2、无操作:前一天有股票状态下的收益) dp[i][1] = max(dp[i-1][0]-prices[i], dp[i-1][1]); //第i天冷冻期下的收益等于前一天有股票状态今天卖出股票下的收益,也就是前一天的持有股票下的收益+今天股票价格 dp[i][2] = dp[i-1][1]+prices[i]; } //最后最大收益一定是手中不持有股票,所以返回最后一天不持有股票状态下和冷冻期状态下中的最大值 return max(dp[prices.size()-1][0],dp[prices.size()-1][2]); } }; int main() { vector<int> prices={1,2,3,0,2}; Solution solute; cout<<solute.maxProfit(prices)<<endl; return 0; }
#pragma once #include "interface.h" enum InitReturnVal_t { INIT_FAILED = 0, INIT_OK, INIT_LAST_VAL, }; class IAppSystem { public: virtual bool Connect(CreateInterfaceFn factory) = 0; virtual void Disconnect() = 0; virtual void *QueryInterface(const char *pInterfaceName) = 0; virtual InitReturnVal_t Init() = 0; virtual void Shutdown() = 0; };
#include<stdio.h> int main() { printf("%d", 0 <= 0); return 0; }
#include <iostream> #include "WizardState.h" WizardState::WizardState(const std::string& name, int health, int damage, int mana) : SpellCasterState(name, health, damage, mana) { std::cout << " creating WizardState " << std::endl; } WizardState::~WizardState() { std::cout << " deleting WizardState " << std::endl; }
// // BoxShape.h // Odin.MacOSX // // Created by Daniel on 10/10/15. // Copyright (c) 2015 DG. All rights reserved. // #ifndef __Odin_MacOSX__BoxShape__ #define __Odin_MacOSX__BoxShape__ #include "AABB.h" #include "Drawable.h" #include "Material.h" namespace odin { namespace render { namespace shape { class BoxShape : public math::shape::AABB, public Drawable { public: BoxShape(); ~BoxShape(); virtual void draw(const RenderStates& states); void setMaterial(Material* material); private: void loadBox(); Material* m_material; static UI32 s_vao; static UI32 s_vbo; static UI32 s_ebo; static bool s_loaded; }; } } } #endif /* defined(__Odin_MacOSX__BoxShape__) */
#include "stdafx.h" #include "Matrix.h" namespace MyDirectX { Matrix::Matrix(int nDimension) { Resize(nDimension); } Matrix::Row& Matrix::operator[](int nIndex) { return vecRow[nIndex]; } void Matrix::Resize(int nDimension) { vecRow.resize(nDimension); for (int i = 0; i < nDimension; i++) { vecRow[i].Resize(nDimension); } } int Matrix::Dimension() { return vecRow.size(); } bool Matrix::operator==(Matrix& mat) { for (int i = 0; i < Dimension(); i++) { for (int j = 0; j < Dimension(); j++) { if (fabs(mat[i][j] - (*this)[i][j]) > EPSILON) return false; } } return true; } bool Matrix::operator!=(Matrix& mat) { return !((*this) == mat); } Matrix Matrix::operator+(Matrix& mat) { Matrix ret(Dimension()); for (int i = 0; i < Dimension(); i++) { for (int j = 0; j < Dimension(); j++) { ret[i][j] = (*this)[i][j] + mat[i][j]; } } return ret; } Matrix Matrix::operator-(Matrix& mat) { Matrix ret(Dimension()); for (int i = 0; i < Dimension(); i++) { for (int j = 0; j < Dimension(); j++) { ret[i][j] = (*this)[i][j] - mat[i][j]; } } return ret; } Matrix Matrix::operator*(Matrix& mat) { Matrix ret(Dimension()); for (int i = 0; i < Dimension(); ++i) { for (int j = 0; j < Dimension(); ++j) { ret[i][j] = 0.f; for (int k = 0; k < Dimension(); ++k) { ret[i][j] += (*this)[i][k] * mat[k][j]; } } } return ret; } Matrix Matrix::operator*(float f) { Matrix ret(Dimension()); for (int i = 0; i < Dimension(); i++) { for (int j = 0; j < Dimension(); j++) { ret[i][j] = (*this)[i][j] * f; } } return ret; } Matrix Matrix::Transpose() { Matrix ret(Dimension()); for (int i = 0; i < Dimension(); i++) { for (int j = 0; j < Dimension(); j++) { ret[i][j] = (*this)[j][i]; } } return ret; } Matrix Matrix::Identity(int nDimension) { Matrix ret(nDimension); for (int i = 0; i < nDimension; i++) { for (int j = 0; j < nDimension; j++) { ret[i][j] = (i == j) ? 1 : 0; } } return ret; } //구현을 위해서 Determinent와 Adjoint가 필요함 //분모가 0일 수 없으므로 Determinent가 0이면 Identity를 리턴하도록 함 Matrix Matrix::Inverse(float& fDet) { fDet = Determinent(); if (fabs(fDet) < 0.0001f) return Matrix::Identity(Dimension()); return Adjoint() * (1 / fDet); } //2차 정사각 행렬일 경우 Determinent는 ad-bc //공식 그대로 적음 //구현을 위해서 Cofactor가 필요함 float Matrix::Determinent() { if (Dimension() == 2) { return (*this)[0][0] * (*this)[1][1] - (*this)[0][1] * (*this)[1][0]; } float fDet = 0.0f; for (int i = 0; i < Dimension(); ++i) { fDet += ((*this)[i][0] * Cofactor(i, 0)); } return fDet; } //공식 그대로 적음 //행과 열의 합에 따라 부호가 바뀜 //구현을 위해서 Minor가 필요함 //Minor는 i행 j열 성분을 뺀 행렬의 Determinent float Matrix::Cofactor(int nRow, int nCol) { float fConst = 1.f; if ((nRow + nCol) % 2 == 1) { fConst = -1.f; } return fConst * Minor(nRow, nCol); } //i행 j열 성분을 뺀 행렬의 Determinent //구현을 위해서 Determinent가 필요함 float Matrix::Minor(int nRow, int nCol) { Matrix mat(Dimension() - 1); int nMinorRow = 0; int nMinorCol = 0; for (int i = 0; i < Dimension(); ++i) { if (i == nRow) continue; nMinorCol = 0; for (int j = 0; j < Dimension(); ++j) { if (j == nCol) continue; mat[nMinorRow][nMinorCol] = (*this)[i][j]; ++nMinorCol; } ++nMinorRow; } return mat.Determinent(); } //cofactor의 전치행렬 Matrix Matrix::Adjoint() { Matrix ret(Dimension()); for (int i = 0; i < Dimension(); ++i) { for (int j = 0; j < Dimension(); ++j) { ret[i][j] = Cofactor(i, j); } } return ret.Transpose(); } Matrix Matrix::Translation(Vector2& v) { Matrix mat = Matrix::Identity(4); mat[3][0] = v.x; mat[3][1] = v.y; mat[3][2] = v.z; return mat; } Matrix Matrix::View(Vector2& vEye, Vector2& vLookAt, Vector2& vUp) { Vector2 l = (vLookAt - vEye).Normalize(); Vector2 r = Vector2::Cross(vUp, l).Normalize(); Vector2 u = Vector2::Cross(l, r).Normalize(); Matrix mat = Matrix::Identity(4); mat[0][0] = r.x; mat[0][1] = u.x; mat[0][2] = l.x; mat[1][0] = r.y; mat[1][1] = u.y; mat[1][2] = l.y; mat[2][0] = r.z; mat[2][1] = u.z; mat[2][2] = l.z; mat[3][0] = -Vector2::Dot(r, vEye); mat[3][1] = -Vector2::Dot(u, vEye); mat[3][2] = -Vector2::Dot(l, vEye); //아이덴티티로 초기화 했으니 [3][3]은 안 해도 됨 return mat; } Matrix Matrix::Ortho(float left, float right, float bottom, float top, float zn, float zf) { // 원래 가운데 중점으로 하려고 했는데 2D에서는 불편함 // 현재 만들어진 녀석 left top 기준으로 되어있는데 // 왼쪽 하단으로 바꿔줄꺼 위로 올라갈때 +로 할꺼임 Matrix mat = Matrix::Identity(4); mat[0][0] = 2 / (right - left); mat[1][1] = 2 / (bottom - top); mat[2][2] = 1 / (zf - zn); mat[3][0] = (left + right) / (left - right); //mat[3][1] = (bottom + top) / (bottom - top); mat[3][1] = (top + bottom) / (top - bottom); mat[3][2] = zn / (zn - zf); //아이덴티티로 초기화 했으니 [3][3]은 안 해도 됨 return mat; } Matrix Matrix::Viewport(float x, float y, float w, float h, float minz, float maxz) { Matrix mat = Matrix::Identity(4); mat[0][0] = w / 2.0f; mat[1][1] = -h / 2.0f; mat[2][2] = maxz - minz; mat[3][0] = x + w / 2.0f; mat[3][1] = y + h / 2.0f; mat[3][2] = minz; //아이덴티티로 초기화 했으니 [3][3]은 안 해도 됨 return mat; } Matrix Matrix::Rotate(float fRadian) { // { cos sin 0 0 // -sin cos 0 0 // 0 0 1 0 // 0 0 0 1 } Matrix matRet = Matrix::Identity(4); matRet[0][0] = cosf(fRadian); matRet[0][1] = sinf(fRadian); matRet[1][0] = -sinf(fRadian); matRet[1][1] = cosf(fRadian); return matRet; } }
/*Напишите программу находящую обратный по модулю элемент. Иначе говоря по числам X и N нужно найти такое число Y, что остаток от деления X*Y на N равняется единице. В программе гарантируется, что все числа - натуральные*/ #include <iostream> using namespace std; bool ready = false; int a, b, i; int main() { b = 0; i = 0; cin >> a; while (!ready) { b = b + a; i++; if (a == 0) ready = true; } cout << b / i; return 0; }
#include <memory> #include <iostream> #include <cstddef> void test0() { char *ptr = static_cast<char*>(std::malloc(100)); std::free(ptr); } template<typename... Ts> struct alignas(Ts...) S {}; struct alignas(32) SS {}; void test1() { std::cout << "size of S = " << sizeof(S<int, double, SS>) << std::endl; } struct SomeStruct { //private: with private does not work float m1; double m2; char m3; char m4; }; void test2() { std::cout << "m1 is at offset = " << offsetof(SomeStruct, m1) << std::endl; std::cout << "m2 is at offset = " << offsetof(SomeStruct, m2) << std::endl; std::cout << "m3 is at offset = " << offsetof(SomeStruct, m3) << std::endl; std::cout << "m4 is at offset = " << offsetof(SomeStruct, m4) << std::endl; std::cout << "size of SomeStruct = " << sizeof(SomeStruct) << std::endl; auto* s = new SomeStruct(); } void test3() { auto ptr = alloca(10); } int main() { test0(); test1(); test2(); test3(); return 0; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #ifdef CANVAS3D_SUPPORT #include "modules/libvega/src/canvas/canvaswebglshader.h" #include "modules/webgl/src/wgl_validator.h" #include "modules/dom/src/canvas/webglconstants.h" CanvasWebGLShader::CanvasWebGLShader(BOOL fragmentShader) : m_shader(NULL), m_fragmentShader(fragmentShader), m_compiled(FALSE), m_variables(NULL) {} CanvasWebGLShader::~CanvasWebGLShader() { OP_DELETE(m_shader); OP_DELETE(m_variables); } OP_STATUS CanvasWebGLShader::compile(const uni_char *url, BOOL validate, unsigned int extensions_enabled) { OP_NEW_DBG("CanvasWebGLShader::compile()", "webgl.shaders"); m_compiled = FALSE; /* Receives the validated/translated shader source */ OpString8 src; if (validate) { m_info_log.Set(""); WGL_Validator::Configuration config; config.for_vertex = !isFragmentShader(); config.console_logging = TRUE; config.output_log = &m_info_log; config.output_source = &src; config.output_format = g_vegaGlobals.vega3dDevice->getShaderLanguage(config.output_version); config.support_higp_fragment = g_vegaGlobals.vega3dDevice->getHighPrecisionFragmentSupport(); /* Both are defaulted to TRUE, but modify these to disable array indexing checks: */ config.fragment_shader_constant_uniform_array_indexing = TRUE; config.clamp_out_of_bound_uniform_array_indexing = TRUE; config.support_oes_derivatives = (extensions_enabled & WEBGL_EXT_OES_STANDARD_DERIVATIVES) != 0; OP_BOOLEAN result; WGL_ShaderVariables *variables = NULL; /* Validate and translate the shader program, using the configuration from 'config', and recording the variables used by the shader (uniforms, varying, and attributes) in m_variables. Even when compiling for platforms that use GLSL, we still generate new code, containing e.g. additional runtime checks. */ /* Need to pass uni_char[]'s to get the format correct; %S seems unreliable. Also, put in horizontal bars to make these a bit easier to pick out. */ OP_DBG((UNI_L("\n%s shader before validation and translation\n=================================================\n%s\n"), isFragmentShader() ? UNI_L("Fragment") : UNI_L("Vertex"), m_source.CStr())); RETURN_IF_ERROR(result = WGL_Validator::Validate(config, url, m_source.CStr(), m_source.Length(), &variables)); OP_DBG(("\n%s shader after validation and translation to %s\n=================================================================\n%s\n", isFragmentShader() ? "Fragment" : "Vertex", config.output_format == VEGA3D_SHADER_LANGUAGE(SHADER_GLSL) ? "GLSL (non-ES)" : config.output_format == VEGA3D_SHADER_LANGUAGE(SHADER_GLSL_ES) ? "GLSL ES" : config.output_format == VEGA3D_SHADER_LANGUAGE(SHADER_HLSL_9) ? "HLSL 9" : config.output_format == VEGA3D_SHADER_LANGUAGE(SHADER_HLSL_10) ? "HLSL 10" : "unknown shader language", src.CStr())); #ifdef _DEBUG if (!m_info_log.IsEmpty()) OP_DBG((UNI_L("\nMessages from %s shader validation\n==========================================\n%s\n"), isFragmentShader() ? UNI_L("fragment") : UNI_L("vertex"), m_info_log.CStr())); #endif // _DEBUG /* Remove records of shader variables from any previous compilation (as the source might have been changed with gl.shaderSource()) */ OP_DELETE(m_variables); m_variables = variables; if (result == OpBoolean::IS_FALSE) return OpStatus::ERR; } else RETURN_IF_ERROR(src.Set(m_source)); VEGA3dShader* shader; unsigned int attribute_count = 0; VEGA3dDevice::AttributeData *attributes = NULL; if (!isFragmentShader() && m_variables) RETURN_IF_ERROR(m_variables->GetAttributeData(attribute_count, attributes)); OP_STATUS status = g_vegaGlobals.vega3dDevice->createShader(&shader, m_fragmentShader, src.CStr(), attribute_count, attributes, &m_info_log); #ifdef _DEBUG if (!m_info_log.IsEmpty()) OP_DBG((UNI_L("\nMessages from %s shader compilation\n===========================================\n%s\n"), isFragmentShader() ? UNI_L("fragment") : UNI_L("vertex"), m_info_log.CStr())); #endif // _DEBUG WGL_ShaderVariables::ReleaseAttributeData(attribute_count, attributes); if (OpStatus::IsError(status) && !OpStatus::IsMemoryError(status)) OP_ASSERT(!"Shader compiler should not be passed incompatible input."); RETURN_IF_ERROR(status); m_compiled = TRUE; OP_DELETE(m_shader); m_shader = shader; return OpStatus::OK; } void CanvasWebGLShader::destroyInternal() { OP_DELETE(m_shader); m_shader = NULL; } #endif // CANVAS3D_SUPPORT
#ifndef _CDL_UDP_SERVER_H_ #define _CDL_UDP_SERVER_H_ #include <string.h> #include "poller.h" #include "net.h" class CDL_UDP_Server : public CPollerObject { public: CDL_UDP_Server(){}; virtual ~CDL_UDP_Server(){}; virtual int OnPacketComplete(const char * data, int len,char* ip,int port)=0; virtual int ParsePacket(char * data, int len)=0; virtual int Send(const char * buff, int len,char* dst_ip,int dst_port)=0; }; #endif
#include <iostream> #include <string> #include <cstddef> #include <Windows.h> #include <vector> #include "cpp_primer_config.h" #include "Test01.h" #ifdef USE_TEST01_C using namespace std; void Test01::showMsg(const std::string Str) { cout <<"["<< this->ShowMsgCounter++ <<"] - "<< Str << endl; } unsigned int Test01::getMsgCounter(void) { return this->ShowMsgCounter; } Test01::Test01() { cout << "Object instance done !" << endl; } Test01::~Test01() { cout << "Odject destoryed !" << endl; } int main(void) { Test01 Obj1; Sleep(1000); for (int i = 0; i < 5; i++) { Obj1.showMsg("Hello"); } Sleep(1000); cout << "Process Done, Count : " << Obj1.getMsgCounter() << endl; } #endif
#pragma once #include "struct.h" #include "log.h" #define BB_POOL_TAG 'Esk' UCHAR PiDDBLockPtr_sig[] = "\x48\x8D\x0D\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x4C\x8B\x8C"; UCHAR PiDDBCacheTablePtr_sig[] = "\x66\x03\xD2\x48\x8D\x0D"; //you can also put the sig within the function, but some of the sig ends up on the stack and in the .text section, and causes issues when zeroing the sig memory. EXTERN_C PVOID ResolveRelativeAddress( _In_ PVOID Instruction, _In_ ULONG OffsetOffset, _In_ ULONG InstructionSize ) { ULONG_PTR Instr = (ULONG_PTR)Instruction; LONG RipOffset = *(PLONG)(Instr + OffsetOffset); PVOID ResolvedAddr = (PVOID)(Instr + InstructionSize + RipOffset); return ResolvedAddr; } NTSTATUS BBSearchPattern(IN PCUCHAR pattern, IN UCHAR wildcard, IN ULONG_PTR len, IN const VOID* base, IN ULONG_PTR size, OUT PVOID* ppFound, int index = 0) { ASSERT(ppFound != NULL && pattern != NULL && base != NULL); if (ppFound == NULL || pattern == NULL || base == NULL) return STATUS_ACCESS_DENIED; //STATUS_INVALID_PARAMETER; int cIndex = 0; for (ULONG_PTR i = 0; i < size - len; i++) { BOOLEAN found = TRUE; for (ULONG_PTR j = 0; j < len; j++) { if (pattern[j] != wildcard && pattern[j] != ((PCUCHAR)base)[i + j]) { found = FALSE; break; } } if (found != FALSE && cIndex++ == index) { *ppFound = (PUCHAR)base + i; return STATUS_SUCCESS; } } return STATUS_NOT_FOUND; } PVOID g_KernelBase = NULL; ULONG g_KernelSize = 0; PVOID GetKernelBase(OUT PULONG pSize) { NTSTATUS status = STATUS_SUCCESS; ULONG bytes = 0; PRTL_PROCESS_MODULES pMods = NULL; PVOID checkPtr = NULL; UNICODE_STRING routineName; // Already found if (g_KernelBase != NULL) { if (pSize) *pSize = g_KernelSize; return g_KernelBase; } RtlUnicodeStringInit(&routineName, L"NtOpenFile"); checkPtr = MmGetSystemRoutineAddress(&routineName); if (checkPtr == NULL) return NULL; // Protect from UserMode AV status = ZwQuerySystemInformation(SystemModuleInformation, 0, bytes, &bytes); if (bytes == 0) { log("Invalid SystemModuleInformation size"); return NULL; } pMods = (PRTL_PROCESS_MODULES)ExAllocatePoolWithTag(NonPagedPool, bytes, BB_POOL_TAG); RtlZeroMemory(pMods, bytes); status = ZwQuerySystemInformation(SystemModuleInformation, pMods, bytes, &bytes); if (NT_SUCCESS(status)) { PRTL_PROCESS_MODULE_INFORMATION pMod = pMods->Modules; for (ULONG i = 0; i < pMods->NumberOfModules; i++) { // System routine is inside module if (checkPtr >= pMod[i].ImageBase && checkPtr < (PVOID)((PUCHAR)pMod[i].ImageBase + pMod[i].ImageSize)) { g_KernelBase = pMod[i].ImageBase; g_KernelSize = pMod[i].ImageSize; if (pSize) *pSize = g_KernelSize; break; } } } if (pMods) ExFreePoolWithTag(pMods, BB_POOL_TAG); //log("g_KernelBase: %x", g_KernelBase); //log("g_KernelSize: %x", g_KernelSize); return g_KernelBase; } NTSTATUS BBScanSection(IN PCCHAR section, IN PCUCHAR pattern, IN UCHAR wildcard, IN ULONG_PTR len, OUT PVOID* ppFound, PVOID base = nullptr) { //ASSERT(ppFound != NULL); if (ppFound == NULL) return STATUS_ACCESS_DENIED; //STATUS_INVALID_PARAMETER if (nullptr == base) base = GetKernelBase(&g_KernelSize); if (base == nullptr) return STATUS_ACCESS_DENIED; //STATUS_NOT_FOUND; PIMAGE_NT_HEADERS64 pHdr = RtlImageNtHeader(base); if (!pHdr) return STATUS_ACCESS_DENIED; // STATUS_INVALID_IMAGE_FORMAT; //PIMAGE_SECTION_HEADER pFirstSection = (PIMAGE_SECTION_HEADER)(pHdr + 1); PIMAGE_SECTION_HEADER pFirstSection = (PIMAGE_SECTION_HEADER)((uintptr_t)&pHdr->FileHeader + pHdr->FileHeader.SizeOfOptionalHeader + sizeof(IMAGE_FILE_HEADER)); for (PIMAGE_SECTION_HEADER pSection = pFirstSection; pSection < pFirstSection + pHdr->FileHeader.NumberOfSections; pSection++) { //DbgPrint("section: %s\r\n", pSection->Name); ANSI_STRING s1, s2; RtlInitAnsiString(&s1, section); RtlInitAnsiString(&s2, (PCCHAR)pSection->Name); if (RtlCompareString(&s1, &s2, TRUE) == 0) { PVOID ptr = NULL; NTSTATUS status = BBSearchPattern(pattern, wildcard, len, (PUCHAR)base + pSection->VirtualAddress, pSection->Misc.VirtualSize, &ptr); if (NT_SUCCESS(status)) { *(PULONG64)ppFound = (ULONG_PTR)(ptr); //- (PUCHAR)base //DbgPrint("found\r\n"); return status; } //we continue scanning because there can be multiple sections with the same name. } } return STATUS_ACCESS_DENIED; //STATUS_NOT_FOUND; } extern "C" bool LocatePiDDB(PERESOURCE * lock, PRTL_AVL_TABLE * table) { PVOID PiDDBLockPtr = nullptr, PiDDBCacheTablePtr = nullptr; if (!NT_SUCCESS(BBScanSection("PAGE", PiDDBLockPtr_sig, 0, sizeof(PiDDBLockPtr_sig) - 1, reinterpret_cast<PVOID*>(&PiDDBLockPtr)))) { log("Unable to find PiDDBLockPtr sig."); return false; } if (!NT_SUCCESS(BBScanSection("PAGE", PiDDBCacheTablePtr_sig, 0, sizeof(PiDDBCacheTablePtr_sig) - 1, reinterpret_cast<PVOID*>(&PiDDBCacheTablePtr)))) { log("Unable to find PiDDBCacheTablePtr sig"); return false; } PiDDBCacheTablePtr = PVOID((uintptr_t)PiDDBCacheTablePtr + 3); *lock = (PERESOURCE)(ResolveRelativeAddress(PiDDBLockPtr, 3, 7)); *table = (PRTL_AVL_TABLE)(ResolveRelativeAddress(PiDDBCacheTablePtr, 3, 7)); return true; } PMM_UNLOADED_DRIVER MmUnloadedDrivers; PULONG MmLastUnloadedDriver; BOOLEAN bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask) { for (; *szMask; ++szMask, ++pData, ++bMask) if (*szMask == 'x' && *pData != *bMask) return 0; return (*szMask) == 0; } UINT64 FindPattern(UINT64 dwAddress, UINT64 dwLen, BYTE* bMask, char* szMask) { for (UINT64 i = 0; i < dwLen; i++) if (bDataCompare((BYTE*)(dwAddress + i), bMask, szMask)) return (UINT64)(dwAddress + i); return 0; } NTSTATUS FindMmDriverData( VOID ) { /* * nt!MmLocateUnloadedDriver: * fffff801`51c70394 4c8b15a57e1500 mov r10,qword ptr [nt!MmUnloadedDrivers (fffff801`51dc8240)] * fffff801`51c7039b 4c8bc9 mov r9 ,rcx */ PVOID MmUnloadedDriversInstr = (PVOID)FindPattern((UINT64)g_KernelBase, g_KernelSize, (BYTE*)"\x4C\x8B\x15\x00\x00\x00\x00\x4C\x8B\xC9", "xxx????xxx" ); /* * nt!MiRememberUnloadedDriver+0x59: * fffff801`5201a4c5 8b057ddddaff mov eax,dword ptr [nt!MmLastUnloadedDriver (fffff801`51dc8248)] * fffff801`5201a4cb 83f832 cmp eax,32h */ PVOID MmLastUnloadedDriverInstr = (PVOID)FindPattern((UINT64)g_KernelBase, g_KernelSize, (BYTE*)"\x8B\x05\x00\x00\x00\x00\x83\xF8\x32", "xx????xxx" ); if (MmUnloadedDriversInstr == NULL || MmLastUnloadedDriverInstr == NULL) { return STATUS_NOT_FOUND; } MmUnloadedDrivers = *(PMM_UNLOADED_DRIVER*)ResolveRelativeAddress(MmUnloadedDriversInstr, 3, 7); MmLastUnloadedDriver = (PULONG)ResolveRelativeAddress(MmLastUnloadedDriverInstr, 2, 6); /*log("MmUnloadedDrivers ModuleEnd: %x", MmUnloadedDrivers->ModuleEnd); log("MmUnloadedDrivers ModuleStart: %x", MmUnloadedDrivers->ModuleStart); log("MmUnloadedDrivers Name: %s", MmUnloadedDrivers->Name); log("MmUnloadedDrivers UnloadTime: %x", MmUnloadedDrivers->UnloadTime);*/ //log("MmUnloadedDrivers Addr: %x", MmUnloadedDrivers); //log("MmLastUnloadedDriver Addr: %x", MmLastUnloadedDriver); return STATUS_SUCCESS; } BOOLEAN IsUnloadedDriverEntryEmpty( _In_ PMM_UNLOADED_DRIVER Entry ) { if (Entry->Name.MaximumLength == 0 || Entry->Name.Length == 0 || Entry->Name.Buffer == NULL) { return TRUE; } return FALSE; } BOOLEAN IsMmUnloadedDriversFilled( VOID ) { for (ULONG Index = 0; Index < MM_UNLOADED_DRIVERS_SIZE; ++Index) { PMM_UNLOADED_DRIVER Entry = &MmUnloadedDrivers[Index]; if (IsUnloadedDriverEntryEmpty(Entry)) { return FALSE; } } return TRUE; } ERESOURCE PsLoadedModuleResource; namespace clear { void clearCache(UNICODE_STRING DriverName, ULONG timeDateStamp) { // first locate required variables PERESOURCE PiDDBLock; PRTL_AVL_TABLE PiDDBCacheTable; if (!LocatePiDDB(&PiDDBLock, &PiDDBCacheTable)) { log("ClearCache Failed"); return; } //log("Found PiDDBLock and PiDDBCacheTable"); //log("Found PiDDBLock %x", PiDDBLock); //log("Found PiDDBCacheTable %x", PiDDBCacheTable); // build a lookup entry PiDDBCacheEntry lookupEntry = { }; lookupEntry.DriverName = DriverName; lookupEntry.TimeDateStamp = timeDateStamp; // acquire the ddb resource lock ExAcquireResourceExclusiveLite(PiDDBLock, TRUE); // search our entry in the table auto pFoundEntry = (PiDDBCacheEntry*)RtlLookupElementGenericTableAvl(PiDDBCacheTable, &lookupEntry); if (pFoundEntry == nullptr) { // release the ddb resource lock ExReleaseResourceLite(PiDDBLock); log("ClearCache Failed (Not found)"); return; } // first, unlink from the list RemoveEntryList(&pFoundEntry->List); // then delete the element from the avl table RtlDeleteElementGenericTableAvl(PiDDBCacheTable, pFoundEntry); // release the ddb resource lock ExReleaseResourceLite(PiDDBLock); log("chache cleared"); } NTSTATUS ClearUnloadedDriver( _In_ PUNICODE_STRING DriverName, _In_ BOOLEAN AccquireResource ) { if (AccquireResource) { ExAcquireResourceExclusiveLite(&PsLoadedModuleResource, TRUE); } BOOLEAN Modified = FALSE; BOOLEAN Filled = IsMmUnloadedDriversFilled(); for (ULONG Index = 0; Index < MM_UNLOADED_DRIVERS_SIZE; ++Index) { PMM_UNLOADED_DRIVER Entry = &MmUnloadedDrivers[Index]; if (Modified) { // // Shift back all entries after modified one. // PMM_UNLOADED_DRIVER PrevEntry = &MmUnloadedDrivers[Index - 1]; RtlCopyMemory(PrevEntry, Entry, sizeof(MM_UNLOADED_DRIVER)); // // Zero last entry. // if (Index == MM_UNLOADED_DRIVERS_SIZE - 1) { RtlFillMemory(Entry, sizeof(MM_UNLOADED_DRIVER), 0); } } else if (RtlEqualUnicodeString(DriverName, &Entry->Name, TRUE)) { // // Erase driver entry. // PVOID BufferPool = Entry->Name.Buffer; RtlFillMemory(Entry, sizeof(MM_UNLOADED_DRIVER), 0); ExFreePoolWithTag(BufferPool, 'TDmM'); // // Because we are erasing last entry we want to set MmLastUnloadedDriver to 49 // if list have been already filled. // *MmLastUnloadedDriver = (Filled ? MM_UNLOADED_DRIVERS_SIZE : *MmLastUnloadedDriver) - 1; Modified = TRUE; } } if (Modified) { ULONG64 PreviousTime = 0; // // Make UnloadTime look right. // for (LONG Index = MM_UNLOADED_DRIVERS_SIZE - 2; Index >= 0; --Index) { PMM_UNLOADED_DRIVER Entry = &MmUnloadedDrivers[Index]; if (IsUnloadedDriverEntryEmpty(Entry)) { continue; } if (PreviousTime != 0 && Entry->UnloadTime > PreviousTime) { // // Decrease by random value here maybe. // Entry->UnloadTime = PreviousTime - 100; } PreviousTime = Entry->UnloadTime; } // // Clear remaining entries. // ClearUnloadedDriver(DriverName, FALSE); } if (AccquireResource) { ExReleaseResourceLite(&PsLoadedModuleResource); } return Modified ? STATUS_SUCCESS : STATUS_NOT_FOUND; } }
#ifndef GAME_H #define GAME_H #include <QGraphicsScene> #include "Player.h" #include "Enemy.h" #include <QGraphicsView> #include <QTimer> #include <QObject> #include <QMediaPlayer> #include "Score.h" #include "Health.h" #include <QMouseEvent> class Game : public QGraphicsView { public: // Public Functions Game(); ~Game(); public: // Public Variables QGraphicsScene * scene; int windowHeight; int windowWidth; QMediaPlayer * backgroundMusic; Player * player; Score * score; Health * health; }; #endif // !GAME_H
/** * @author: Karthick < karthikn2099@gmail.com > * @github: https://github.com/karthikn2098 * @date: 10/01/2018 */ #include <bits/stdc++.h> using namespace std; /** * @desc: function to get the pascal triangle number of given row and column... * @param: row , column * @return: pascal number for given row and column. */ int pascal(int row , int column) { if(row == column || column == 0) return 1; return pascal(row - 1 , column - 1) + pascal(row - 1 , column); } int main(void) { int N; cout << "Enter the Number of rows: "; cin >> N; cout << endl; for(int i = 0 ; i < N ; i++ ) { for(int j = 0 ; j <= i ; j++ ) { cout << pascal(i , j) << " "; } cout << "\n"; } return 0; } /* Sample Input/Output: Enter the Number of rows: 5 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 */
#include "NeuralNet.h" using namespace std; ofstream fout; NeuralNet::NeuralNet(int numInput, int numHidden, int numOutput) { //Constructor numTestData = 20; //hard coded for now srand((unsigned int)time(NULL)); //Seeding Random for first time this->numInput = numInput; //Initializing # of Input Nodes this->numHidden = numHidden; //Initializing # of Hidden Nodes this->numOutput = numOutput; //Initializing # of Output Nodes inputs.resize(numInput); //Creating Inputs Array ihWeights.resize(numInput); //Creating 1st layer of multidimensional array (number of inputs) hBiases.resize(numHidden); //Initializing Biases array (1 for each hidden node) for (int i = 0; i < numInput; ++i) //Creating Multidimensional Weights Array where first array index is # of Input node and second is # of Weight ihWeights[i].resize(numHidden); hOutputs.resize(numHidden); //Initializing Outputs Array hoWeights.resize(numHidden); //Initializing first layer of multidimensional array (number of hidden nodes) for (int i = 0; i < numHidden; ++i) //Creating Multidimensional Weights Array where first array index is # of Input node and second is # of Weight hoWeights[i].resize(numOutput); outputs.resize(numOutput); //Creating Outputs Array oBiases.resize(numOutput); //Creating Output Biases Array hGrads.resize(numHidden); //Resizing Gradients oGrads.resize(numOutput); //Resizing Gradients ihPrevWeightsDelta.resize(numInput); for (int i = 0; i < numInput; ++i) ihPrevWeightsDelta[i].resize(numHidden); hPrevBiasesDelta.resize(numHidden); hoPrevWeightsDelta.resize(numHidden); for (int i = 0; i < numHidden; ++i) hoPrevWeightsDelta[i].resize(numOutput); oPrevBiasesDelta.resize(numOutput); fout.open("Data.txt"); } NeuralNet::~NeuralNet() { //Destructor fout.close(); system("pause"); } double** NeuralNet::MakeMatrix(int rows, int cols)// Retired - this was used for dynamic arrays using pointers { //2 Dimensional Dynamic Array double** matrix = new double*[rows]; for (int i = 0; i < rows; i++) { matrix[i] = new double[cols]; } return matrix; } void NeuralNet::MakeTrainTest(std::vector< std::vector<double> >& AllData, std::vector< std::vector<double> >& TrainData, std::vector< std::vector<double> >& TestData) { //Split AllData into 80% trainData and 20% testData int totRows = AllData.size(); int numCols = AllData[0].size(); int trainRows = (int)(totRows*0.80);//hard coded 80-20 split int testRows = totRows - trainRows; vector<double> trainData; vector<double> testData; TrainData.resize(trainRows); for (int i = 0; i < trainRows; i++) { TrainData[i].resize(numCols); } TestData.resize(testRows); for (int i = 0; i < testRows; i++) { TestData[i].resize(numCols); } vector<int> sequence(totRows); for (size_t i = 0; i < sequence.size(); ++i) sequence[i] = i; for (size_t i = 0; i < sequence.size(); ++i) { int r = (int)(GenerateRand() * sequence.size()); int tmp = sequence[r]; sequence[r] = sequence[i]; sequence[i] = tmp; } int si = 0; // index into sequence[] int j = 0; // index into trainData or testData int idx = 0; for (; si < trainRows; ++si) { idx = sequence[si]; CopyArray(AllData[idx], 0, TrainData[j], 0, numCols); ++j; } j = 0; for (; si < totRows; ++si) { idx = sequence[si]; CopyArray(AllData[idx], 0, TestData[j], 0, numCols); ++j; } } void NeuralNet::Normalize(std::vector< std::vector<double> >& DataMatrix, std::vector<int> cols) { //normalize specified cols by computing (x - mean) / sd for each value for each (int col in cols) { double sum = 0.0; for (size_t i = 0; i < DataMatrix.size(); ++i) sum += DataMatrix[i][col]; double mean = sum / DataMatrix.size(); sum = 0.0; for (size_t i = 0; i < DataMatrix.size(); ++i) sum += (DataMatrix[i][col] - mean) * (DataMatrix[i][col] - mean); double sd = sqrt(sum / (DataMatrix.size() - 1)); for (size_t i = 0; i < DataMatrix.size(); ++i) DataMatrix[i][col] = (DataMatrix[i][col] - mean) / sd; } } void NeuralNet::InitializeWeights() { //Initialize Weights and biases to small random values int numWeights = (numInput * numHidden) + (numHidden * numOutput) + numHidden + numOutput; vector<double> initialWeights(numWeights); double lo = -0.01; //------(-0.01)---|---(0.01)------ double hi = 0.01; for (size_t i = 0; i < initialWeights.size(); ++i) initialWeights[i] = (hi - lo) * GenerateRand() + lo; SetWeights(initialWeights); } void NeuralNet::ExportWeights(string filename) { //ofstream fout(filename); // // // // //fout.close(); // // //// returns the current set of weights, presumably after training //int numWeights = (numInput * numHidden) + (numHidden * numOutput) + numHidden + numOutput; //result.resize(numWeights); //int k = 0; // //for (int i = 0; i < ihWeights.size(); ++i) // for (int j = 0; j < ihWeights[0].size(); ++j) // result[k++] = ihWeights[i][j]; //for (int i = 0; i < hBiases.size(); ++i) // result[k++] = hBiases[i]; //for (int i = 0; i < hoWeights.size(); ++i) // for (int j = 0; j < hoWeights[0].size(); ++j) // result[k++] = hoWeights[i][j]; //for (int i = 0; i < oBiases.size(); ++i) // result[k++] = oBiases[i]; } void NeuralNet::GetWeights(vector<double>& result) { // returns the current set of weights, presumably after training int numWeights = (numInput * numHidden) + (numHidden * numOutput) + numHidden + numOutput; result.resize(numWeights); int k = 0; for (size_t i = 0; i < ihWeights.size(); ++i) for (size_t j = 0; j < ihWeights[0].size(); ++j) result[k++] = ihWeights[i][j]; for (size_t i = 0; i < hBiases.size(); ++i) result[k++] = hBiases[i]; for (size_t i = 0; i < hoWeights.size(); ++i) for (size_t j = 0; j < hoWeights[0].size(); ++j) result[k++] = hoWeights[i][j]; for (size_t i = 0; i < oBiases.size(); ++i) result[k++] = oBiases[i]; } void NeuralNet::SetWeights(vector<double> weights) { numWeights = (numInput * numHidden) + (numHidden * numOutput) + numHidden + numOutput; if (weights.size() != numWeights) { cout << "Bad weights array length" << endl; exit(0); } //Take the weights and biases from weights array and put them in i-h weights, h-o weights, h-o biases int k = 0; //points into weights param for (int i = 0; i < numInput; ++i) for (int j = 0; j < numHidden; ++j) ihWeights[i][j] = weights[k++]; for (int i = 0; i < numHidden; ++i) hBiases[i] = weights[k++]; for (int i = 0; i < numHidden; ++i) for (int j = 0; j < numOutput; ++j) hoWeights[i][j] = weights[k++]; for (int i = 0; i < numOutput; ++i) oBiases[i] = weights[k++]; } void NeuralNet::Train(vector< vector<double> >& trainData, int maxEpochs, double learnRate, double momentum, double weightDecay) { // train a back-prop style NN classifier using learning rate and momentum // weight decay reduces the magnitude of a weight value over time unless that value // is constantly increased int epoch = 0; vector<double> xValues(numInput); vector<double> tValues(numOutput); float PercentageComp = 0.0; //Need method of fetching data here - Data then needs to be processed in random order vector<int> Sequence(trainData.size()); for (size_t i = 0; i < trainData.size(); ++i) Sequence[i] = i; while (epoch < maxEpochs) { double mse = MeanSquaredError(trainData); if (mse < 0.020) break; // consider passing value in as parameter //if (mse < 0.001) break; Shuffle(Sequence); // visit each training data in random order for (size_t i = 0; i < trainData.size(); ++i) { int idx = Sequence[i]; CopyArray(trainData[idx], 0, xValues, 0, numInput); CopyArray(trainData[idx], numInput, tValues, 0, numOutput); ComputeOutputs(xValues); // copy xValues in, compute outputs (store them internally) UpdateWeights(tValues, learnRate, momentum, weightDecay); // find better weights StoreDatabase(0); }// each training tuple ++epoch; PercentageComp = ((float)epoch / (float)maxEpochs) * 100; cout << "Percentage Complete: " << PercentageComp << endl; } StoreDatabase(1); } void NeuralNet::Shuffle(vector<int>& Sequence) { for (int i = 0; i < numTestData; ++i) { int r = (int)GenerateRand()*numTestData; int tmp = Sequence[r]; Sequence[r] = Sequence[i]; Sequence[i] = tmp; } } void NeuralNet::StoreDatabase(int i) { if (i == 0) { fout << "Input:,"; for (size_t i = 0; i < inputs.size(); i++) fout << inputs[i] << ","; fout << ",Outputs:,"; for (size_t i = 0; i < outputs.size(); i++) fout << outputs[i] << ","; fout << endl; } else if (i == 1) { fout << endl; int k = 0; for (size_t i = 0; i < ihWeights.size(); ++i) for (size_t j = 0; j < ihWeights[0].size(); ++j) fout << ihWeights[i][j] << endl; for (size_t i = 0; i < hBiases.size(); ++i) fout << hBiases[i] << endl; for (size_t i = 0; i < hoWeights.size(); ++i) for (size_t j = 0; j < hoWeights[0].size(); ++j) fout << hoWeights[i][j] << endl; for (size_t i = 0; i < oBiases.size(); ++i) fout << oBiases[i] << endl; } } double NeuralNet::MeanSquaredError(vector< vector<double> >& TrainData) { //Average squared error per training tuple double sumSquaredError = 0.0; vector<double> xValues(numInput); //First numInput values in trainData vector<double> tValues(numOutput);// last numOutput values //Walk through each training case, looks like (6.9 3.2 5.7 2.3) (0 0 1) //numTestData = size of traindata for (size_t i = 0; i < TrainData.size(); ++i) { CopyArray(TrainData[i], 0, xValues, 0, numInput); CopyArray(TrainData[i], numInput, tValues, 0, numOutput); vector<double> yValues = ComputeOutputs(xValues); for (int j = 0; j < numOutput; j++) { double err = tValues[j] - yValues[j]; sumSquaredError += err*err; } } return sumSquaredError / numTestData; } vector<double> NeuralNet::ComputeOutputs(vector<double> xValues) { vector<double> hSums(numHidden); //hidden nodes sums scratch array vector<double> oSums(numOutput); // output nodes sums for (int i = 0; i < numInput; ++i) inputs[i] = xValues[i]; for (int j = 0; j < numHidden; ++j) for (int i = 0; i < numInput; ++i) hSums[j] += inputs[i] * ihWeights[i][j]; for (int i = 0; i < numHidden; ++i) hSums[i] += hBiases[i]; for (int i = 0; i < numHidden; ++i) //Apply Activation function hOutputs[i] = HyperTanFunction(hSums[i]); for (int j = 0; j < numOutput; ++j) for (int i = 0; i < numHidden; ++i) oSums[j] += hOutputs[i] * hoWeights[i][j]; for (int i = 0; i < numOutput; ++i) oSums[i] += oBiases[i]; vector<double> softOut = Softmax(oSums); //softmax activation does all outputs at once for efficiency CopyArray(softOut, 0, outputs, 0, numOutput); vector<double> retResult(numOutput); // could define a getOutputs method instead CopyArray(outputs, 0, retResult, 0, numOutput); return retResult; } double NeuralNet::HyperTanFunction(double x) { if (x < -20.0) return -1.0; //approximation is correct to 30 decimals else if (x > 20.0) return 1.0; else return tanh(x); } vector<double> NeuralNet::Softmax(vector<double> oSums) { // Determine max output sum // does all output nodes at once so scale doesn't have to be re-computed each time double max = oSums[0]; for (size_t i = 0; i < oSums.size(); ++i) { if (oSums[i] > max) max = oSums[i]; } //Determine scaling factor -- sum of exp(each val - max) double scale = 0.0; for (size_t i = 0; i < oSums.size(); ++i) scale += exp(oSums[i] - max); vector<double> result(oSums.size()); for (size_t i = 0; i < oSums.size(); ++i) result[i] = exp(oSums[i] - max) / scale; return result; // now scaled so that xi sum to 1.0 } void NeuralNet::UpdateWeights(vector<double> tValues, double learnRate, double momentum, double weightDecay) { //1. Compute output gradients for (int i = 0; i < numOutput; ++i) { // derivative of softmax = (1 - y) * y (same as log-sigmoid) double derivative = (1 - outputs[i]) * outputs[i]; // mean squared error version include (1-y)(y) derivative oGrads[i] = derivative * (tValues[i] - outputs[i]); } //2. compute hidden gradients for (int i = 0; i < numHidden; ++i) { // derivative of tanh = (1 - y) * (1 + y) double derivative = (1 - hOutputs[i]) * (1 + hOutputs[i]); double sum = 0.0; for (int j = 0; j < numOutput; ++j) //each hidden delta is the sum of numOutput terms { double x = oGrads[j] * hoWeights[i][j]; sum += x; } hGrads[i] = derivative * sum; } //3a. update hidden weights (gradients must be computed right-to-left but weights // can be updated in any order) for (int i = 0; i < numInput; ++i) { for (int j = 0; j < numHidden; ++j) { double delta = learnRate * hGrads[j] * inputs[i]; // compute the new delta ihWeights[i][j] += delta; //update. note we use '+' instead of '-' this can be very tricky //now add momentum using previous delta. on first pass old value will be 0.0 but that's ok. ihWeights[i][j] += momentum * ihPrevWeightsDelta[i][j]; ihWeights[i][j] -= (weightDecay * ihWeights[i][j]); // weight decay ihPrevWeightsDelta[i][j] = delta; // don't forget to save the delta for momentum } } //3b. update hidden biases for (int i = 0; i < numHidden; ++i) { double delta = learnRate * hGrads[i] * 1.0; //t1.0 is constant input for bias; could leave out hBiases[i] += delta; hBiases[i] += momentum * hPrevBiasesDelta[i]; // momentum hBiases[i] -= (weightDecay * hBiases[i]); // weight decay hPrevBiasesDelta[i] = delta; // don't forget to save the delta for momentum } //4. update hidden-output weights for (int i = 0; i < numHidden; ++i) { for (int j = 0; j < numOutput; ++j) { // see above: hOutputs are inputs to the nn outputs double delta = learnRate * oGrads[j] * hOutputs[i]; hoWeights[i][j] += delta; hoWeights[i][j] += momentum * hoPrevWeightsDelta[i][j]; // momentum hoWeights[i][j] -= (weightDecay * hoWeights[i][j]); // weight decay hoPrevWeightsDelta[i][j] = delta; // save } } //4b. update output biases for (int i = 0; i < numOutput; ++i) { double delta = learnRate * oGrads[i] * 1.0; oBiases[i] += delta; oBiases[i] += momentum * oPrevBiasesDelta[i]; // momentum oBiases[i] -= (weightDecay * oBiases[i]); // weight decay oPrevBiasesDelta[i] = delta; // save } } double NeuralNet::Accuracy(std::vector< std::vector<double> >& testData) { // percentage correct using winner-takes all int numCorrect = 0; int numWrong = 0; double result; vector<double> xValues(numInput); //inputs vector<double> tValues(numOutput); //targets vector<double> yValues; //computed Y for (size_t i = 0; i < testData.size(); ++i) { CopyArray(testData[i], 0, xValues, 0, numInput); CopyArray(testData[i], numInput, tValues, 0, numOutput); yValues = ComputeOutputs(xValues); int maxIndex = MaxIndex(yValues); //which cell in yValue has largest value? if (tValues[maxIndex] == 1.0) // ugly. consider AreEqual(double x, double y) ++numCorrect; else ++numWrong; } if (numCorrect + numWrong == 0.0) { cout << "[~] Accuracy function: Division by 0 not allowed." << endl; exit(0); } result = (numCorrect *1.0) / (numCorrect + numWrong); return result; } int NeuralNet::MaxIndex(std::vector<double> vector) { // index of largest value int bigIndex = 0; double biggestVal = vector[0]; for (size_t i = 0; i < vector.size(); ++i) { if (vector[i] > biggestVal) { biggestVal = vector[i]; bigIndex = i; } } return bigIndex; } void NeuralNet::CopyArray(vector<double>& SourceArray, int SourceArrayIdx, vector<double>& DestinationArray, int DestinationIndex, int length) { int k = DestinationIndex; for (int i = SourceArrayIdx; i < SourceArrayIdx + length; i++) { DestinationArray[k] = SourceArray[i]; k++; } }
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> typedef long double LD; typedef long long LL; typedef unsigned long long ULL; typedef unsigned int uint; #define PI 3.1415926535897932384626433832795 #define sqr(x) ((x)*(x)) using namespace std; #define N 111111 int w, n, ans = 0, x[N], y[N], xx[N], yy[N]; bool Eq(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { int A = y2 - y1; int B = x1 - x2; int C = -A * x1 - B * y1; return A * x3 + B * y3 + C == 0 && A * x4 + B * y4 + C == 0; } bool Par(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { int A1 = y2 - y1; int B1 = x1 - x2; int A2 = y4 - y3; int B2 = x3 - x4; return A1 * B2 == A2 * B1; } int main() { // freopen(".in", "r", stdin); // freopen(".out", "w", stdout); cin >> w >> n; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i] >> xx[i] >> yy[i]; bool bad = false; for (int j = 0; j < i; j++) if (Eq(x[i], y[i], xx[i], yy[i], x[j], y[j], xx[j], yy[j])) { bad = true; break; } ans += !bad; } bool allPar = true; for (int i = 1; i < n; i++) { allPar &= Par(x[i], y[i], xx[i], yy[i], x[i-1], y[i-1], xx[i-1], yy[i-1]); } int mi = 0; if (allPar) { if (ans + 1 >= w) { cout << 0 << endl; return 0; } else { mi = 1; } } cout << max(mi, (w + 1)/2 - ans) << endl; return 0; }
#ifndef SOFTBODY_H #define SOFTBODY_H #include "object.h" ///Not implemented class softbody:public Object { public: softbody(); ~softbody(); void makeBody(btScalar mass); private: }; #endif // SOFTBODY_H
// Created on: 1992-05-06 // Created by: Jacques GOUSSARD // Copyright (c) 1992-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _IntPatch_TheIWalking_HeaderFile #define _IntPatch_TheIWalking_HeaderFile #include <Adaptor3d_Surface.hxx> #include <IntSurf_SequenceOfPathPoint.hxx> #include <math_Vector.hxx> #include <IntWalk_VectorOfWalkingData.hxx> #include <IntWalk_VectorOfInteger.hxx> #include <IntSurf_PntOn2S.hxx> #include <gp_Vec.hxx> #include <gp_Dir2d.hxx> #include <TColStd_SequenceOfInteger.hxx> #include <TColStd_DataMapOfIntegerListOfInteger.hxx> #include <IntPatch_SequenceOfIWLineOfTheIWalking.hxx> #include <IntSurf_SequenceOfInteriorPoint.hxx> #include <Standard_Integer.hxx> #include <TColStd_SequenceOfReal.hxx> #include <IntWalk_StatusDeflection.hxx> #include <Bnd_Range.hxx> class IntSurf_PathPoint; class IntSurf_PathPointTool; class IntSurf_InteriorPoint; class IntSurf_InteriorPointTool; class Adaptor3d_HSurfaceTool; class IntPatch_TheSurfFunction; class IntPatch_TheIWLineOfTheIWalking; class IntSurf_PntOn2S; class math_FunctionSetRoot; class IntPatch_TheIWalking { public: DEFINE_STANDARD_ALLOC //! Deflection is the maximum deflection admitted between two //! consecutive points on a resulting polyline. //! Step is the maximum increment admitted between two //! consecutive points (in 2d space). //! Epsilon is the tolerance beyond which 2 points //! are confused. //! theToFillHoles is the flag defining whether possible holes //! between resulting curves are filled or not //! in case of IntPatch walking theToFillHoles is False Standard_EXPORT IntPatch_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step, const Standard_Boolean theToFillHoles = Standard_False); //! Deflection is the maximum deflection admitted between two //! consecutive points on a resulting polyline. //! Step is the maximum increment admitted between two //! consecutive points (in 2d space). //! Epsilon is the tolerance beyond which 2 points //! are confused void SetTolerance (const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step); //! Searches a set of polylines starting on a point of Pnts1 //! or Pnts2. //! Each point on a resulting polyline verifies F(u,v)=0 Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, IntPatch_TheSurfFunction& Func, const Handle(Adaptor3d_Surface)& S, const Standard_Boolean Reversed = Standard_False); //! Searches a set of polylines starting on a point of Pnts1. //! Each point on a resulting polyline verifies F(u,v)=0 Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Func, const Handle(Adaptor3d_Surface)& S, const Standard_Boolean Reversed = Standard_False); //! Returns true if the calculus was successful. Standard_Boolean IsDone() const; //! Returns the number of resulting polylines. //! An exception is raised if IsDone returns False. Standard_Integer NbLines() const; //! Returns the polyline of range Index. //! An exception is raised if IsDone is False. //! An exception is raised if Index<=0 or Index>NbLines. const Handle(IntPatch_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const; //! Returns the number of points belonging to Pnts on which no //! line starts or ends. //! An exception is raised if IsDone returns False. Standard_Integer NbSinglePnts() const; //! Returns the point of range Index . //! An exception is raised if IsDone returns False. //! An exception is raised if Index<=0 or //! Index > NbSinglePnts. const IntSurf_PathPoint& SinglePnt (const Standard_Integer Index) const; protected: Standard_EXPORT Standard_Boolean Cadrage (math_Vector& BornInf, math_Vector& BornSup, math_Vector& UVap, Standard_Real& Step, const Standard_Integer StepSign) const; Standard_EXPORT Standard_Boolean TestArretPassage (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, IntPatch_TheSurfFunction& Section, math_Vector& UV, Standard_Integer& Irang); Standard_EXPORT Standard_Boolean TestArretPassage (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const math_Vector& UV, const Standard_Integer Index, Standard_Integer& Irang); Standard_EXPORT Standard_Boolean TestArretAjout (IntPatch_TheSurfFunction& Section, math_Vector& UV, Standard_Integer& Irang, IntSurf_PntOn2S& PSol); Standard_EXPORT void FillPntsInHoles (IntPatch_TheSurfFunction& Section, TColStd_SequenceOfInteger& CopySeqAlone, IntSurf_SequenceOfInteriorPoint& PntsInHoles); Standard_EXPORT void TestArretCadre (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const Handle(IntPatch_TheIWLineOfTheIWalking)& Line, IntPatch_TheSurfFunction& Section, math_Vector& UV, Standard_Integer& Irang); Standard_EXPORT IntWalk_StatusDeflection TestDeflection (IntPatch_TheSurfFunction& Section, const Standard_Boolean Finished, const math_Vector& UV, const IntWalk_StatusDeflection StatusPrecedent, Standard_Integer& NbDivision, Standard_Real& Step, const Standard_Integer StepSign); Standard_EXPORT void ComputeOpenLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Section, Standard_Boolean& Rajout); Standard_EXPORT void OpenLine (const Standard_Integer N, const IntSurf_PntOn2S& Psol, const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Section, const Handle(IntPatch_TheIWLineOfTheIWalking)& Line); Standard_EXPORT Standard_Boolean IsValidEndPoint (const Standard_Integer IndOfPoint, const Standard_Integer IndOfLine); Standard_EXPORT void RemoveTwoEndPoints (const Standard_Integer IndOfPoint); Standard_EXPORT Standard_Boolean IsPointOnLine (const gp_Pnt2d& theP2d, const Standard_Integer Irang); Standard_EXPORT void ComputeCloseLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, IntPatch_TheSurfFunction& Section, Standard_Boolean& Rajout); Standard_EXPORT void AddPointInCurrentLine (const Standard_Integer N, const IntSurf_PathPoint& PathPnt, const Handle(IntPatch_TheIWLineOfTheIWalking)& CurrentLine) const; Standard_EXPORT void MakeWalkingPoint (const Standard_Integer Case, const Standard_Real U, const Standard_Real V, IntPatch_TheSurfFunction& Section, IntSurf_PntOn2S& Psol); //! Clears up internal containers Standard_EXPORT void Clear(); //! Returns TRUE if thePOn2S is in one of existing lines. Standard_EXPORT Standard_Boolean IsPointOnLine(const IntSurf_PntOn2S& thePOn2S, const math_Vector& theInfBounds, const math_Vector& theSupBounds, math_FunctionSetRoot& theSolver, IntPatch_TheSurfFunction& theFunc); private: Standard_Boolean done; IntSurf_SequenceOfPathPoint seqSingle; Standard_Real fleche; Standard_Real pas; math_Vector tolerance; Standard_Real epsilon; Standard_Boolean reversed; IntWalk_VectorOfWalkingData wd1; IntWalk_VectorOfWalkingData wd2; IntWalk_VectorOfInteger nbMultiplicities; Bnd_Range mySRangeU; // Estimated U-range for section curve Bnd_Range mySRangeV; // Estimated V-range for section curve Standard_Real Um; Standard_Real UM; Standard_Real Vm; Standard_Real VM; IntSurf_PntOn2S previousPoint; gp_Vec previousd3d; gp_Dir2d previousd2d; TColStd_SequenceOfInteger seqAjout; TColStd_SequenceOfInteger seqAlone; TColStd_DataMapOfIntegerListOfInteger PointLineLine; IntPatch_SequenceOfIWLineOfTheIWalking lines; Standard_Boolean ToFillHoles; }; #define ThePointOfPath IntSurf_PathPoint #define ThePointOfPath_hxx <IntSurf_PathPoint.hxx> #define ThePointOfPathTool IntSurf_PathPointTool #define ThePointOfPathTool_hxx <IntSurf_PathPointTool.hxx> #define ThePOPIterator IntSurf_SequenceOfPathPoint #define ThePOPIterator_hxx <IntSurf_SequenceOfPathPoint.hxx> #define ThePointOfLoop IntSurf_InteriorPoint #define ThePointOfLoop_hxx <IntSurf_InteriorPoint.hxx> #define ThePointOfLoopTool IntSurf_InteriorPointTool #define ThePointOfLoopTool_hxx <IntSurf_InteriorPointTool.hxx> #define ThePOLIterator IntSurf_SequenceOfInteriorPoint #define ThePOLIterator_hxx <IntSurf_SequenceOfInteriorPoint.hxx> #define ThePSurface Handle(Adaptor3d_Surface) #define ThePSurface_hxx <Adaptor3d_Surface.hxx> #define ThePSurfaceTool Adaptor3d_HSurfaceTool #define ThePSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx> #define TheIWFunction IntPatch_TheSurfFunction #define TheIWFunction_hxx <IntPatch_TheSurfFunction.hxx> #define IntWalk_TheIWLine IntPatch_TheIWLineOfTheIWalking #define IntWalk_TheIWLine_hxx <IntPatch_TheIWLineOfTheIWalking.hxx> #define IntWalk_SequenceOfIWLine IntPatch_SequenceOfIWLineOfTheIWalking #define IntWalk_SequenceOfIWLine_hxx <IntPatch_SequenceOfIWLineOfTheIWalking.hxx> #define Handle_IntWalk_TheIWLine Handle(IntPatch_TheIWLineOfTheIWalking) #define IntWalk_IWalking IntPatch_TheIWalking #define IntWalk_IWalking_hxx <IntPatch_TheIWalking.hxx> #include <IntWalk_IWalking.lxx> #undef ThePointOfPath #undef ThePointOfPath_hxx #undef ThePointOfPathTool #undef ThePointOfPathTool_hxx #undef ThePOPIterator #undef ThePOPIterator_hxx #undef ThePointOfLoop #undef ThePointOfLoop_hxx #undef ThePointOfLoopTool #undef ThePointOfLoopTool_hxx #undef ThePOLIterator #undef ThePOLIterator_hxx #undef ThePSurface #undef ThePSurface_hxx #undef ThePSurfaceTool #undef ThePSurfaceTool_hxx #undef TheIWFunction #undef TheIWFunction_hxx #undef IntWalk_TheIWLine #undef IntWalk_TheIWLine_hxx #undef IntWalk_SequenceOfIWLine #undef IntWalk_SequenceOfIWLine_hxx #undef Handle_IntWalk_TheIWLine #undef IntWalk_IWalking #undef IntWalk_IWalking_hxx #endif // _IntPatch_TheIWalking_HeaderFile
/**************************************** @_@ Cat Got Bored *_* #_# *****************************************/ #include <stdio.h> #define loop(i,s,e) for(int i = s;i<=e;i++) //including end point #define pb(a) push_back(a) #define sqr(x) ((x)*(x)) #define CIN ios_base::sync_with_stdio(0); cin.tie(0); #define ll long long #define ull unsigned long long #define SZ(a) int(a.size()) #define read() freopen("input.txt", "r", stdin) #define write() freopen("output.txt", "w", stdout) #define ms(a,b) memset(a, b, sizeof(a)) #define all(v) v.begin(), v.end() #define PI acos(-1.0) #define pf printf #define sfi(a) scanf("%d",&a); #define sfii(a,b) scanf("%d %d",&a,&b); #define sfl(a) scanf("%lld",&a); #define sfll(a,b) scanf("%lld %lld",&a,&b); #define mp make_pair #define paii pair<int, int> #define padd pair<dd, dd> #define pall pair<ll, ll> #define fs first #define sc second #define CASE(t) printf("Case %d: ",++t) // t initialized 0 #define INF 1000000000 //10e9 #define EPS 1e-9 using namespace std; /* int l_cards[1009]; int cards[1009]; int temp_cards[1009]; void double_shuffle(int N) { loop(x,1,N) { int p1 = cards[x]; int p2 = cards[p1]; temp_cards[x] = p2; } loop(x,1,N) cards[x] = temp_cards[x]; } int main() { int N,S; sfii(N,S); loop(x,1,N) sfi(cards[x]); //First operation //cards[1] = l_cards[N]; loop(x,2,N) { // cards[x] = l_cards[x-1]; } loop(s,1,S) { double_shuffle(N); } loop(x,1,N) pf("%d\n",cards[x]); return 0; } */ const int MAXN=1010; int a[MAXN]; int b[MAXN]; int c[MAXN]; int n,m; int min_cycle_length() { int j; int cnt=0; while(1) { for(int i=1;i<=n;i++) b[i]=c[c[i]]; cnt++; for(j=1;j<=n;j++) if(b[j]!=a[j]) break; if(j>n)break; for(int i=1;i<=n;i++) c[i]=b[i]; } return cnt; } int main() { while(scanf("%d%d",&n,&m)==2) { for(int i=1;i<=n;i++) { scanf("%d",&a[i]); c[i]=a[i]; b[i]=a[i]; } int cnt=min_cycle_length(); m%=cnt; m=cnt-m; while(m--) { for(int i=1;i<=n;i++) b[i]=a[a[i]]; for(int i=1;i<=n;i++) a[i]=b[i]; } for(int i=1;i<=n;i++) printf("%d\n",b[i]); } return 0; }
#ifndef DELETEDIALOGUE_H #define DELETEDIALOGUE_H #include "QWidget" #include "memory" #include "note.h" #include "notetreeitem.h" namespace Ui { class DeleteDialogue; } class DeleteDialogue : public QWidget { Q_OBJECT public: explicit DeleteDialogue(std::unique_ptr<QList<Note*>>, QWidget *parent = 0); ~DeleteDialogue(); signals: void deleteNotes(std::shared_ptr<QList<Note*>>); private slots: void sendDeleteList(); private: void setupList(); void setupItem(Note * const note, QTreeWidgetItem * const item) const; int showConfirmation(bool isSingle); Ui::DeleteDialogue *ui; std::unique_ptr<QList<Note*>> notes; std::map<int, Note*> indexMap; }; #endif // DELETEDIALOGUE_H
// // 11659.cpp // baekjoon // // Created by 최희연 on 2021/07/07. // #include <iostream> using namespace std; int main(){ int n, m; scanf("%d %d", &n, &m); int arr[100001]; for(int i=0;i<n;i++){ int a; scanf("%d", &a); arr[i+1] = arr[i]+a; } while (m--) { int i, j; scanf("%d %d", &i, &j); int sum = arr[j]-arr[i-1]; printf("%d\n", sum); } }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef SCOPE_ID_TABLE_H #define SCOPE_ID_TABLE_H #ifdef SCOPE_SUPPORT #include "modules/util/OpHashTable.h" /** * OpScopeIDTable is a bidirectional mapping between an integral ID, and * a pointer. The ID range is 1 and up. * * This class does not own its objects, and so does not delete the table * entries in the destructor. For that, use OpScopeAutoIDTable. * * Each OpScopeIDTable has a reference count which refers to the permanence * of the IDs of the managed objects. The reference count does *not* refer * to the object itself. Whenever a Release causes the reference count to hit * zero, the hash tables will be cleared, and the object counter reset. * * Please note that the reference count is initially zero. */ template<class T> class OpScopeIDTable { public: /** * Constructor. Inits next_id to 1. */ OpScopeIDTable(); /** * Destructor. Does nothing currently. */ virtual ~OpScopeIDTable(); /** * Remove and/or delete all table elements, then set ID counter * to @c 1. */ virtual void Purge(); /** * Call release, then retain immediately. This *may* cause a Purge, if * the reference count hits zero after the first release. */ void Reset(); /** * Increase the reference count by one. */ OpScopeIDTable<T> *Retain(); /** * Decrease the reference count by one. This *may* cause a Purge, if * it causes the reference count to hit zero. */ void Release(); /** * Get the integral ID for the object @c t, or create one if * there is no ID yet. * * @param t [in] The object to create an integral ID for. * @param id [out] The resulting ID. * @return OpStatus::OK if an ID was found or created, * OpStatus::ERR_NO_MEMORY otherwise. */ OP_STATUS GetID(T *t, unsigned &id); /** * Get the object associated with the specified ID. * * @param id [in] The ID of the object. * @param t [out] A pointer to the object. * @return OpStatus::OK if the object was found, or * OpStatus::ERR if the ID did not exist. * (Never OOM). */ OP_STATUS GetObject(unsigned id, T *&t) const; /** * Checks if the object @a t is contained in the ID table. * * @param t [in] The object to check for. * @return @c TRUE if object was found or @c FALSE otherwise. */ BOOL HasObject(T *t) const; /** * Removes the contained object associated with the specified ID. * * @param id [in] The ID of the object. * @return OpStatus::OK if the object was found and removed, or * OpStatus::ERR if the ID did not exist. * (Never OOM) */ OP_STATUS RemoveID(unsigned id); protected: /** * Add an object to the map. * * @param id The ID of the object. * @param t A pointer to the object. * @return OpStatus::OK if the object was added, * OpStatus::ERR if the object already existed, or * OpStatus::ERR_NO_MEMORY. */ OP_STATUS Add(unsigned id, T *t); // The next available ID. unsigned next_id; // Mapping between integral ID and the pointer. OpPointerHashTable<void, T> id_to_obj; // Mapping between the pointer and the integral ID. OpPointerIdHashTable<T, unsigned> obj_to_id; // The number of references to this object. unsigned ref_count; }; /** * OpScopeAutoIDTable is a bidirectional mapping between an integral ID, * and a pointer. The ID range is 1 and up. * * This class will delete the pointers referenced in the table in the * destructor, and in the reset method. OpScopeIDTable is a similar class * which doesn't delete its table enties. */ template<class T> class OpScopeAutoIDTable : public OpScopeIDTable<T> { public: /** * Destructor. Deletes all pointers in the table. */ virtual ~OpScopeAutoIDTable(); /** * Removes all integral IDs, deletes all pointers, and resets * ID count to @c 1. */ virtual void Purge(); /** * Deletes all objects and IDs, but does not reset the ID counter. */ void DeleteAll(); /** * Deletes the contained object associated with the specified ID. * * @param[in] id The ID of the object. * @return OpStatus::OK if the object was found and removed, or * OpStatus::ERR if the ID did not exist. (Never OOM) */ OP_STATUS DeleteID(unsigned id); /** * Deletes the specified object and its ID. If the object is not part * of this ID table, OpStatus::ERR is returned. * * @param[in] t The object to delete. * @return OpStatus::OK if the object was found and removed, or * OpStatus::ERR if the object did not exist. (Never OOM). */ OP_STATUS DeleteObject(T *t); }; // OpScopeIDTable template<class T> OpScopeIDTable<T>::OpScopeIDTable() : next_id(1) , ref_count(0) { } template<class T> OpScopeIDTable<T>::~OpScopeIDTable() { } template<class T> /* virtual */ void OpScopeIDTable<T>::Purge() { id_to_obj.RemoveAll(); obj_to_id.RemoveAll(); next_id = 1; } template<class T> void OpScopeIDTable<T>::Reset() { Release(); Retain(); } template<class T> OpScopeIDTable<T>* OpScopeIDTable<T>::Retain() { ++ref_count; return this; } template<class T> void OpScopeIDTable<T>::Release() { OP_ASSERT(ref_count); if (ref_count != 0) --ref_count; if (ref_count == 0) this->Purge(); } template<class T> OP_STATUS OpScopeIDTable<T>::GetID(T *t, unsigned &id) { if (OpStatus::IsError(obj_to_id.GetData(t, &id))) { id = next_id++; return Add(id, t); } return OpStatus::OK; } template<class T> BOOL OpScopeIDTable<T>::HasObject(T *t) const { unsigned id; if (OpStatus::IsError(obj_to_id.GetData(t, &id))) return FALSE; return TRUE; } template<class T> OP_STATUS OpScopeIDTable<T>::GetObject(unsigned id, T *&t) const { void *id_ptr = reinterpret_cast<void*>(static_cast<UINTPTR>(id)); return id_to_obj.GetData(id_ptr, &t); } template<class T> OP_STATUS OpScopeIDTable<T>::Add(unsigned id, T *t) { OP_ASSERT(t); void *id_ptr = reinterpret_cast<void*>(static_cast<UINTPTR>(id)); RETURN_IF_ERROR(id_to_obj.Add(id_ptr, t)); OP_STATUS status = obj_to_id.Add(t, id); if (OpStatus::IsError(status)) id_to_obj.Remove(id_ptr, &t); return status; } template<class T> OP_STATUS OpScopeIDTable<T>::RemoveID(unsigned id) { void *id_ptr = reinterpret_cast<void*>(static_cast<UINTPTR>(id)); T *tmp = NULL; if (OpStatus::IsError(id_to_obj.GetData(id_ptr, &tmp))) return OpStatus::ERR; RETURN_IF_ERROR(id_to_obj.Remove(id_ptr, &tmp)); unsigned removed; return obj_to_id.Remove(tmp, &removed); } // OpScopeAutoIDTable template<class T> OpScopeAutoIDTable<T>::~OpScopeAutoIDTable() { // Explicit |this| so that the calls depend on the template type this->id_to_obj.DeleteAll(); } template<class T> /* virtual */ void OpScopeAutoIDTable<T>::Purge() { // Explicit |this| so that the calls depend on the template type this->DeleteAll(); this->next_id = 1; } template<class T> /* virtual */ void OpScopeAutoIDTable<T>::DeleteAll() { // Explicit |this| so that the calls depend on the template type. this->id_to_obj.DeleteAll(); this->obj_to_id.RemoveAll(); } template<class T> OP_STATUS OpScopeAutoIDTable<T>::DeleteID(unsigned id) { void *id_ptr = reinterpret_cast<void*>(static_cast<UINTPTR>(id)); T *tmp = NULL; if (OpStatus::IsError(this->id_to_obj.GetData(id_ptr, &tmp))) return OpStatus::ERR; OP_DELETE(tmp); RETURN_IF_ERROR(this->id_to_obj.Remove(id_ptr, &tmp)); unsigned removed; return this->obj_to_id.Remove(tmp, &removed); } template<class T> OP_STATUS OpScopeAutoIDTable<T>::DeleteObject(T *t) { unsigned removed; RETURN_IF_ERROR(this->obj_to_id.Remove(t, &removed)); OP_DELETE(t); void *id_ptr = reinterpret_cast<void*>(static_cast<UINTPTR>(removed)); return this->id_to_obj.Remove(id_ptr, &t); } #endif // SCOPE_SUPPORT #endif // SCOPE_ID_TABLE_H
//=========================================================================== //! @file asset_texture_manager.cpp //! @brief テクスチャ管理クラス //=========================================================================== //--------------------------------------------------------------------------- //! 初期化 //--------------------------------------------------------------------------- bool AssetTextureManager::initialize() { //============================================================= // システムテクスチャ初期化 //============================================================= systemTextures_[SYSTEM_TEXTURE_NULL_WHITE].reset(this->createTexture("texture/system/NullWhite.dds")); systemTextures_[SYSTEM_TEXTURE_NULL_BLACK].reset(this->createTexture("texture/system/NullBlack.dds")); systemTextures_[SYSTEM_TEXTURE_NULL_NORMAL].reset(this->createTexture("texture/system/NullNormal.png")); systemTextures_[SYSTEM_TEXTURE_CUBEMAP_NULL_BLACK].reset(this->createTexture("texture/system/NullBlackCubemap.dds")); systemTextures_[SYSTEM_TEXTURE_TOON].reset(this->createTexture("texture/system/toon.png")); for(u32 i = 0; i < (u32)std::size(systemTextures_); ++i) { if(!systemTextures_[i]) { GM_ASSERT_MESSAGE(false, "システムテクスチャ初期化失敗"); return false; } } return true; } //--------------------------------------------------------------------------- //! 解放 //--------------------------------------------------------------------------- void AssetTextureManager::cleanup() { for(auto& systemTexture : systemTextures_) { systemTexture.reset(); } for(auto& assetTexture : assetTextures_) { auto texture = assetTexture.second; if(texture) { texture.reset(); } } assetTextures_.clear(); } //--------------------------------------------------------------------------- //! システムテクスチャ取得 //--------------------------------------------------------------------------- std::shared_ptr<gpu::Texture> AssetTextureManager::getSystemTexture(SYSTEM_TEXTURE type) { if(SYSTEM_TEXTURE_MAX <= type) { GM_ASSERT_MESSAGE(false, "getSystemTexture()"); } return systemTextures_[type]; } //--------------------------------------------------------------------------- //! テクスチャ取得 //--------------------------------------------------------------------------- std::shared_ptr<gpu::Texture> AssetTextureManager::getTexture(const std::string& fileName, [[maybe_unused]] bool isCubemap) { // ない場合 if(!assetTextures_.count(fileName)) { auto texture = this->createTexture(fileName); if(!texture) { GM_ASSERT_MESSAGE(false, "テクスチャの作成に失敗"); return nullptr; } this->addTexture(fileName, texture); } return assetTextures_[fileName]; } //--------------------------------------------------------------------------- //! テクスチャ作成 //--------------------------------------------------------------------------- gpu::Texture* AssetTextureManager::createTexture(const std::string& fileName, bool isCubemap) { std::unique_ptr<gpu::Texture> texture(gpu::createTexture(fileName, isCubemap)); if(!texture) { return nullptr; } return texture.release(); } //--------------------------------------------------------------------------- //! テクスチャ追加 //--------------------------------------------------------------------------- void AssetTextureManager::addTexture(const std::string& fileName, gpu::Texture* assetTexture) { assetTextures_.insert(std::make_pair(fileName, assetTexture)); }
#include "OutCardProc.h" #include "HallHandler.h" #include "Logger.h" #include "ProcessManager.h" #include "GameCmd.h" #include "GameServerConnect.h" #include "PlayerManager.h" #include <string> //REGISTER_PROCESS(CLIENT_MSG_OUT_CARD, OutCardProc) OutCardProc::OutCardProc() { this->name = "OutCardProc"; } OutCardProc::~OutCardProc() { } int OutCardProc::doRequest(CDLSocketHandler * client, InputPacket * inputPacket, Context * pt) { HallHandler* clientHandler = reinterpret_cast <HallHandler*> (client); Player* player = PlayerManager::getInstance()->getPlayer(clientHandler->uid); if (player == NULL) return 0; //设置变量 player->current_user_pos_ = INVALID_CHAIR; player->action_ = WIK_NULL; player->m_cbActionCard = 0; //删除牌 player->game_logic_.RemoveCard(player->m_cbCardIndex[player->m_TableIndex], player->OperateCard_); OutputPacket requestPacket; requestPacket.Begin(CLIENT_MSG_OPERATE_CARD, player->m_Uid); requestPacket.WriteInt(player->m_Uid); requestPacket.WriteInt(player->OperateCard_); requestPacket.End(); this->send(clientHandler, &requestPacket); /*printf("Send ComingGameProc Packet to Server\n"); printf("Data Send: player->id=[%d]\n", player->id); printf("Data Send: player->name=[%s]\n", "robot"); printf("Data Send: player->id=[%d]\n", player->id); printf("Data Send: player->money=[%ld]\n", player->money); printf("Data Send: player->clevel=[%d]\n", player->clevel);*/ return 0; } int OutCardProc::doResponse(CDLSocketHandler * clientHandler, InputPacket * inputPacket, Context * pt) { return 0; }
#ifndef WIZARDPAGE_H #define WIZARDPAGE_H #include "Wizard.h" #include "WizardButtons.h" #include "BreadCrumbs.h" #include <QWidget> #include <QSharedPointer> #include <QList> namespace RsaToolbox { class Wizard; class BreadCrumbs; class WizardButtons; class WizardPage; typedef QList<WizardPage*> WizardPages; class WizardPage : public QWidget { Q_OBJECT friend class Wizard; public: explicit WizardPage(QWidget *parent = 0); ~WizardPage(); QString name() const; void setName(QString name); int nextIndex() const; void setNextIndex(int index); bool isFinalPage() const; void setFinalPage(bool isFinalPage); // Enter forward virtual void initialize(); virtual bool skip(); // Leave forward virtual bool isReadyForNext(); virtual int next(); // Enter backward virtual bool skipBackwards() const; virtual void backToThis(); // Leave backward virtual bool isReadyForBack(); virtual void back(); virtual void resetContents(); signals: void enableNext(bool isEnabled); void enableBack(bool isEnabled); protected: WizardPage *pageAt(int index); Wizard *wizard() const; virtual void setWizard(Wizard *wizard); BreadCrumbs *breadCrumbs() const; WizardButtons *buttons () const; ErrorLabel *errorLabel () const; TimedProgressBar *progressBar() const; void clearHistory(); private: QString _name; bool _isFinal; int _next; Wizard *_wizard; }; } // RsaToolbox #endif // WIZARDPAGE_H
#include "EmployeeOptions.h" void EmployeeOptions::getLog(const LogUpdates &logUpdates, int globalId, const std::shared_ptr<BaseCallback> callback, std::shared_ptr<BaseClient> client, std::shared_ptr<CallbacksHolder> callbackHolder) { throw std::runtime_error("exception: employee can't get server log"); } void EmployeeOptions::registration(const UserInfo &authInfo, int globalId, const std::shared_ptr<BaseCallback> callback, std::shared_ptr<BaseClient> client, std::shared_ptr<CallbacksHolder> callbackHolder) { throw std::runtime_error("exception: employee can't register new user"); }
/* HashMap.cpp by Alan Agon a1636896 */ #include <iostream> #include <string> #include <assert.h> #include "hashMap.h" using namespace std; //Constructors HashMap::HashMap(int capacity) { //Confirm the input capacity is valid if( capacity>0 && capacity<2147483647 ){ size= 0; cap= capacity; hashTable= new objField*[cap]; for( int i=0;i<cap;i++ ){ hashTable[i]= NULL; } }else{ cout<<"Whoops, invalid capacity!"; assert(capacity>0 && capacity<2147483647); } } //Return the capacity of this HashMap int HashMap::capacity() { return cap; } //Return the number of items in this HashMap int HashMap::hashSize() { return size; } //Add data to the HashMap void HashMap::add(string name, int number) { //Check if add will cause a collision. Chaining(linked lists) to avoid collisions int hashInd= hashfn(name, cap); if( hashTable[hashInd]==NULL ){ hashTable[hashInd]= new objField; hashTable[hashInd]->name= name; hashTable[hashInd]->number= number; size++; }else{ //Temporary pointers to find where the end of the chain is (p is one step ahead of q) objField *p= hashTable[hashInd]; objField *q= NULL; while( p!=NULL ){ q= p; p= p->next; } //q now points at the last node in the chain and thus we can make a new objField q->next= new objField; q->next->name= name; q->next->number= number; size++; } } //Remove data from the HashMap void HashMap::remove(string name) { //An easy way to check if the entry exists is re-use find() if( find(name)>0 ){ int hashInd= hashfn(name, cap); //Check to see if theres any chained entries if( hashTable[hashInd]->next==NULL ){ //Just delete the node and set to NULL free(hashTable[hashInd]); hashTable[hashInd]= NULL; }else{ //A little harder } }else{ cout<< "Entry not found!" << endl; } } //Find data int HashMap::find(string name) { objField* p= hashTable[hashfn(name,cap)]; if( p==NULL ){ return -1; }else{ int number= p->number; return number; } } //Dump contents void HashMap::dump() { for( int i=0;i<cap;i++ ){ if( hashTable[i]==NULL ){ cout << "Empty" << endl; }else{ objField* p= hashTable[i]; while ( p!=NULL ){ cout << "Name: " << p->name << "\t\t" << "Number: " << p->number << endl; p= p->next; } } } } unsigned int HashMap::hashfn(string str, unsigned int n) { //I'm using a Shift-Add-XOR Hash function here unsigned int h= 0; for( int i=0; i<str.length(); i++ ){ h ^= (h<<5)+(h>>2)+str[i]; } return h%n; }
#ifndef LISTAD_H #define LISTAD_H #include <iostream> using namespace std; #include "NodoD.h" class ListaD { private: NodoD* inicio; NodoD* fin; public: ListaD(void){ inicio = NULL; fin = NULL; } void muestraTusDatosA(void){ NodoD* aux; aux = inicio; if(laListaEstaVacia()){ cout << "La lista esta vacia" << endl; } while(aux != NULL){ cout << aux->dameTuValor() << " "; aux = aux->dameTuSiguiente(); } } void muestraTusDatosD(void){ NodoD* aux; aux = fin; if(laListaEstaVacia()){ cout << "La lista esta vacia" << endl; } while(aux != NULL){ cout << aux->dameTuValor() << " "; aux = aux->dameTuAnterior(); } } bool laListaEstaVacia(void){ return inicio == NULL; } void inserta(int v){ if(!laListaEstaVacia()){ if(v <= inicio->dameTuValor()){ // Inserta un nodo al inicio de la lista inicio->modificaTuAnterior(new NodoD(v,NULL,inicio)); inicio = inicio->dameTuAnterior(); } else{ if(v > fin->dameTuValor()){ // Inserta un nodo al final de la lista fin->modificaTuSiguiente(new NodoD(v,fin,NULL)); fin = fin->dameTuSiguiente(); } else{ NodoD* aux = inicio; while(v > aux->dameTuValor()){ aux = aux->dameTuSiguiente(); } aux->dameTuAnterior()->modificaTuSiguiente(new NodoD(v,aux->dameTuAnterior(),aux)); aux->modificaTuAnterior(aux->dameTuAnterior()->dameTuSiguiente()); } } } else{ inicio = new NodoD(v,NULL,NULL); // Inserta un nodo si la lista esta vacia fin = inicio; } } void borra(int v){ NodoD* aux; if(!laListaEstaVacia()){ if(v <= fin->dameTuValor()){ // Prueba logica: el valor mayor al valor de fin nunca estara en la lista if(v == inicio->dameTuValor()){ // Borra un nodo si esta al inicio aux = inicio; inicio->dameTuSiguiente()->modificaTuAnterior(NULL); inicio = inicio->dameTuSiguiente(); delete aux; } else{ // Borra un nodo en cualquier posicion de la lista aux = inicio; while(v > aux->dameTuValor()){ aux = aux->dameTuSiguiente(); } if(v == aux->dameTuValor()){ aux->dameTuAnterior()->modificaTuSiguiente(aux->dameTuSiguiente()); aux->dameTuSiguiente()->modificaTuAnterior(aux->dameTuAnterior()); delete aux; } else cout << "El valor no esta en la lista" << endl; } } else cout << "El valor no esta en la lista" << endl; } else cout << "La lista esta vacia" << endl; } }; #endif // LISTAD_H
#pragma once #include<iostream> #include<string> using namespace std; class Monhoc { private: string TenMonhoc; int SoChiMonhoc; float DiemMonhoc; public: string GetMonhoc() { return TenMonhoc; } void SetMonhoc(string x) { TenMonhoc = x; } int Getsochi() { return SoChiMonhoc; } void Setsochi( int value) { SoChiMonhoc = value; } float Getdiem() { return DiemMonhoc; } void Setdiem(float value) { DiemMonhoc = value; } Monhoc(); Monhoc( string, int, float); ~Monhoc(); //Method Input void InputMonhoc(); void OutMonhoc(); //Method With Operator friend istream& operator >>(istream &, Monhoc &); friend ostream& operator <<(ostream&, Monhoc); };
//lamuto partition //partition using the element as pivot //4 5 2 9 8 1 6 #include <iostream> //#include "lomuto.h" using namespace std; void swap(int [],int,int); void lomutoP(int arr[], int n){ int p=arr[n-1]; int j=0; for(int i=0;i<n;i++){ if(arr[i]<=p){ swap(arr,i,j); j++; } } for (int i = 0; i < n; i++) { std::cout << arr[i] << '\t'; } } void swap(int arr[],int i,int j){ int temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } /* int main(int argc, char const *argv[]) { int arr[]={4 ,5, 2, 9, 8 ,1 ,6}; int n=sizeof(arr)/sizeof(arr[0]); lomutoP(arr,n); return 0; } */
/* Author : Bhavin Kotak */ #include <iostream> #include <algorithm> #include <utility> using namespace std; class Edge{ int source; int destination; int weight; public: Edge(){ } Edge(int source, int destination, int weight){ this->source = source; this->destination = destination; this->weight = weight; } bool operator < (const Edge& edge) const { return (weight < edge.weight); } int getSource(){ return source; } int getDestination(){ return destination; } int getWeight(){ return weight; } }; class Graph{ int node; int edge; vector <int> parent; vector <Edge> edges; public: Graph(){ } Graph(int node, int edge){ //edges = new vector<Edge>(); this->node = node; this->edge = edge; for(int i = 0; i < node; i++) parent.push_back(i); } int getNodes(){ return node; } int getEdges(){ return edge; } void addEdge(int source, int destination){ addEdge(source, destination, 0); } void addEdge(int source, int destination, int weight){ edges.push_back(Edge(source, destination, weight)); } int root(int x) { while(parent[x] != x) { parent[x] = parent[parent[x]]; x = parent[x]; } return x; } void union1(int x, int y){ int p = root(x); int q = root(y); parent[p] = parent[q]; } int Krushkal(){ int minCost = 0; std::sort(edges.begin(), edges.end()); for(int i = 0; i < edge; i++){ int x = edges[i].getSource(); int y = edges[i].getDestination(); if(root(x) != root(y) ){ union1(x, y); minCost += edges[i].getWeight(); //cout<<edges[i].getWeight(); } } return minCost; } }; int main(){ Graph graph; int nodes; int edges; int minCost; cin>> nodes >> edges; graph = Graph(nodes, edges); int x, y, w; for(int i = 0; i < edges; i++){ cin>> x >> y >> w; graph.addEdge(x, y, w); } cout<<graph.Krushkal(); }
/* * MonteCarloPrintFunctions.cc * * Created on: Nov 23, 2009 * Author: acodas */ #include "MonteCarloPrintFunctions.h" #include <stdio.h> #include <stdlib.h> #include <string.h> //@tested //prints a mc_Point void mc_printPoint(const mc_Point p) { printf("{x=%g, y=%g, theta=%g}", p.x, p.y, p.theta); } //@tested //prints the matrix A void mc_printMatrix(const double A[3][3]) { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { printf("%g ", A[i][j]); } printf("\n"); } } int mc_printSamples(const char OUTPUT_FILE_NAME[],const mc_Points *currentPoints){ int numberPrinting = MAXMCNSAMPLES; char * pHome; char location[128]; pHome = getenv("HOME"); strcpy(location,pHome); strcat(location,"/simulation/results/"); strcat(location,OUTPUT_FILE_NAME); FILE* outputFile = fopen(location, "w"); if(outputFile == NULL){ printf("Invalid File to write results. File 'path' == %s \n",location); return 1; } if (numberPrinting > mc_nSamples) { numberPrinting = mc_nSamples; } fprintf(outputFile, "m = ["); int i; for (i = 0; i < numberPrinting - 1; ++i) { fprintf(outputFile, "\n\t%lf,\t%lf,\t%lf,\t%.20lf;", currentPoints->points[i].x, currentPoints->points[i].y, currentPoints->points[i].theta, currentPoints->weights[i]); } fprintf(outputFile, "\n\t%lf,\t%lf,\t%lf,\t%.20lf];", currentPoints->points[i].x, currentPoints->points[i].y, currentPoints->points[i].theta, currentPoints->weights[i]); fprintf(outputFile, "\nparticules = struct('pos',m);\n"); fprintf(outputFile, "simulations = [simulations particules];\n"); fclose(outputFile); return 0; } //prints the current samples with an introduction text //prints tag detections void mc_printTagDetections(const TagDetection* tagDetections) { const TagDetection* aux = tagDetections; int tagNum = -2; while (aux != 0) { if (tagNum == tagNumber(aux->tagid)) { printf(" %d", aux->antenna); } else { tagNum = tagNumber(aux->tagid); printf("\nTagDetection %d %s - antennas %d", tagNum, aux->tagid, aux->antenna); } aux = aux->next; } printf("\n"); } void mc_printTagsExpected(const TagExpectation* tagsExpected) { const TagExpectation* aux = tagsExpected; int tagNum; while (aux != 0) { if (tagNum == tagNumber(aux->tagid)) { printf("\n%s antenna %d - probability %lf ", aux->tagid, aux->antenna, aux->probability); } else { tagNum = tagNumber(aux->tagid); printf("\nTagExpectation %d %s\n", tagNum, aux->tagid); printf("\n%s antenna %d - probability %lf ", aux->tagid, aux->antenna, aux->probability); } aux = aux->next; } printf("\n"); }
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn = 10000; int main() { char p[maxn]; int lenp; cin >> p; lenp = strlen(p); int next[lenp]; int k = -1; int j = 0; next[0] = -1; while(j < lenp - 1) { if(k == -1 || p[j] == p[k]) { ++k; ++j; next[j] = k; cout << 111 << endl; } else { k = next[k]; cout << 222 << endl; } } printf("%d\n", k); return 0; }
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \*********************************************************/ //[-------------------------------------------------------] //[ Include ] //[-------------------------------------------------------] #include "Renderer/PlatformTypes.h" // This is for the internal implementation only, other projects will use the public "Renderer/Public/Renderer.h"-header, // so it's acceptable to make an include in here // Disable warnings in external headers, we can't fix them PRAGMA_WARNING_PUSH PRAGMA_WARNING_DISABLE_MSVC(4365) // warning C4365: 'return': conversion from 'int' to 'std::char_traits<wchar_t>::int_type', signed/unsigned mismatch PRAGMA_WARNING_DISABLE_MSVC(4668) // warning C4668: '_M_HYBRID_X86_ARM64' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' PRAGMA_WARNING_DISABLE_MSVC(4987) // warning C4987: nonstandard extension used: 'throw (...)' #include <cmath> #include <algorithm> PRAGMA_WARNING_POP //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] namespace Renderer { //[-------------------------------------------------------] //[ Public static methods ] //[-------------------------------------------------------] inline uint32_t ITexture::getNumberOfMipmaps(uint32_t width) { // Don't write "return static_cast<uint32_t>(1 + std::floor(std::log2(width)));" // -> Android GNU STL has no "std::log2()", poor but no disaster in here because we can use another solution // -> log2(x) = log(x) / log(2) // -> log(2) = 0.69314718055994529 return static_cast<uint32_t>(1 + std::floor(std::log(width) / 0.69314718055994529)); } inline uint32_t ITexture::getNumberOfMipmaps(uint32_t width, uint32_t height) { return getNumberOfMipmaps(std::max(width, height)); } inline uint32_t ITexture::getNumberOfMipmaps(uint32_t width, uint32_t height, uint32_t depth) { return getNumberOfMipmaps(width, std::max(height, depth)); } //[-------------------------------------------------------] //[ Public methods ] //[-------------------------------------------------------] inline ITexture::~ITexture() { // Nothing here } //[-------------------------------------------------------] //[ Protected methods ] //[-------------------------------------------------------] inline ITexture::ITexture(ResourceType resourceType, IRenderer& renderer) : IResource(resourceType, renderer) { // Nothing here } //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] } // Renderer
#include <iostream> using namespace std; int f(int a, int n){ if(n == 0) return 1; if(n == 1) return a; return a * f(a,n-1); } string f2(int x){ string res = ""; while(x > 0){ res = char(x % 2 + 48) + res; x = x / 2; } return res; } string f3(string s, int i){ s[s.size() - 1 - i] = '0'; return s; } int f4(string s){ int res = 0; for(int i = 0; i < s.size(); ++i){ res = res + int(s[i]-48) * f(2,s.size() - 1 - i); } return res; } int main(){ int x,i; cin >> x >> i; string s = f2(x); string t = f3(s,i); int y = f4(t); cout << y << endl; return 0; }
/**************************************************************************************** Copyright (C) 2017 Autodesk, Inc. All rights reserved. Use of this software is subject to the terms of the Autodesk license agreement provided at the time of installation or download, or which otherwise accompanies this software in either electronic or hard copy form. ****************************************************************************************/ #include "DisplayLight.h" FileWrite myFile3("../biFile.bff"); FileWrite myStringFile3("../stringFile.bff"); LightBFF lightData; void DisplayDefaultAnimationValues(FbxLight* pLight); void DisplayLight(FbxNode* pNode) { FbxLight* lLight = (FbxLight*) pNode->GetNodeAttribute(); DisplayString("Light Name: ", (char *) pNode->GetName()); char temp[64]; strcpy_s(temp, _countof(temp), pNode->GetName()); for (int i = 0; i < sizeof(temp); i++) lightData.name[i] = temp[i]; DisplayMetaDataConnections(lLight); const char* lLightTypes[] = { "Point", "Directional", "Spot", "Area", "Volume" }; DisplayString(" Type: ", lLightTypes[lLight->LightType.Get()]); strcpy_s(temp, _countof(temp), lLightTypes[lLight->LightType.Get()]); for (int i = 0; i < sizeof(temp); i++) lightData.type[i] = temp[i]; DisplayBool(" Cast Light: ", lLight->CastLight.Get()); if (!(lLight->FileName.Get().IsEmpty())) { DisplayString(" Gobo"); DisplayString(" File Name: \"", lLight->FileName.Get().Buffer(), "\""); DisplayBool(" Ground Projection: ", lLight->DrawGroundProjection.Get()); DisplayBool(" Volumetric Projection: ", lLight->DrawVolumetricLight.Get()); DisplayBool(" Front Volumetric Projection: ", lLight->DrawFrontFacingVolumetricLight.Get()); } DisplayDefaultAnimationValues(lLight); myStringFile3.writeToStringFile("\n\n\n------------- Light\n\n"); myStringFile3.writeToStringFile( "Name: " + (std::string)lightData.name + "\n" + "\n" + "Type: " + (std::string)lightData.type + "\n" + "\n" + "ColorR: " + std::to_string(lightData.color[0]) + "\n" + "ColorG: " + std::to_string(lightData.color[1]) + "\n" + "ColorB: " + std::to_string(lightData.color[2]) + "\n" + "\n" + "Dir: " + std::to_string(lightData.dir) + "\n" + "\n" + "Intencity: " + std::to_string(lightData.intencity) + "\n"); } void DisplayDefaultAnimationValues(FbxLight* pLight) { DisplayString(" Default Animation Values"); FbxDouble3 c = pLight->Color.Get(); FbxColor lColor(c[0], c[1], c[2]); DisplayColor(" Default Color: ", lColor); lightData.color[0] = lColor[0]; lightData.color[1] = lColor[1]; lightData.color[2] = lColor[2]; DisplayDouble(" Default Intensity: ", pLight->Intensity.Get()); lightData.intencity = pLight->Intensity.Get(); DisplayDouble(" Default Outer Angle: ", pLight->OuterAngle.Get()); lightData.dir = pLight->OuterAngle.Get(); DisplayDouble(" Default Fog: ", pLight->Fog.Get()); }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef WINDOWSPLUGINDETECTOR_H #define WINDOWSPLUGINDETECTOR_H #if defined(_PLUGIN_SUPPORT_) && !defined(NS4P_COMPONENT_PLUGINS) class OpPluginDetectionListener; class WindowsPluginDetector { public: WindowsPluginDetector(OpPluginDetectionListener *listener) : m_listener(listener) , m_acrobat_installed(FALSE) , m_svg_installed(FALSE) , m_qt_installed(FALSE) , m_wmp_installed(FALSE) , m_wmp_detection_done(FALSE) , m_read_from_registry(FALSE) {} OP_STATUS ReadPlugins(const OpStringC& suggested_plugin_paths); // check if the plugin is for this architecture (win32 or x64) BOOL IsPluginForArchitecture(const OpStringC& plugin_path); private: enum PluginType { ACROBAT, SVG, QT, WMP }; struct PluginInfo { OpString product_name; OpString mime_type; OpString extensions; OpString file_open_name; OpString description; OpString plugin; OpString version; }; OP_STATUS CheckReplacePlugin(PluginType type, BOOL& ignore, const OpStringC& checkedFileDescription = NULL); OP_STATUS InsertPluginPath(const OpStringC& plugin_path, BOOL* was_different = NULL, const OpStringC& checkedFileDescription = NULL, BOOL is_replacement = FALSE); OP_STATUS ReadFromRegistry(); OP_STATUS ReadEntries(const HKEY hk); OP_STATUS InsertPlugin(const OpStringC& productName, const OpStringC& mimeType, const OpStringC& fileExtensions, const OpStringC& fileOpenName, const OpStringC& fileDescription, const OpStringC& plugin, const OpStringC& version); OP_STATUS SubmitPlugins(); BOOL IsVersionNewer (const OpStringC& existing, const OpStringC& added); OP_STATUS RemovePlugin(const OpStringC& productName); OpPluginDetectionListener *m_listener; BOOL m_acrobat_installed; BOOL m_svg_installed; BOOL m_qt_installed; BOOL m_wmp_installed; // set only when "new" (np-mswmp.dll) plugin is available BOOL m_wmp_detection_done; // tracks if we looked for np-mswmp.dll already BOOL m_read_from_registry; OpString m_latest_seen_java_name; OpString m_latest_seen_java_version; OpAutoStringHashTable<PluginInfo> m_plugin_list; }; #endif // _PLUGIN_SUPPORT_ && !NS4P_COMPONENT_PLUGINS #endif // !WINDOWSPLUGINDETECTOR_H
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <sstream> #include <complex> typedef long double LD; typedef long long LL; typedef unsigned long long ULL; typedef unsigned int uint; #define PI 3.1415926535897932384626433832795 #define sqr(x) ((x)*(x)) using namespace std; int main() { // ios::sync_with_stdio(false); freopen("seed", "r", stdin); int seed; cin >> seed; srand(seed); const int n = 50000; const int Q = 50000; const int R = 3; const int P1 = 17; const int P2 = 19; const int V = 100000; int T = 2; cout << T << endl; while (T--) { int N = n; cout << N << " " << Q << " " << R << " " << P1 << " " << P2 << "\n"; for (int i = 0; i < N; ++i) cout << (rand() % V) << " "; cout << "\n"; for (int i = 0; i < Q; ++i) { int t = rand() % 3; if (t == 0) { int l = (rand() % N) + 1; int r = l + rand() % (N - l + 1); cout << "0 " << (rand() % V) << " " << (rand() % V) << " " << l << " " << r << "\n"; } else if (t == 1) { cout << "1 " << (rand() % N + 1) << " " << (rand() % V) << "\n"; } else { int l = (rand() % N) + 1; int r = l + rand() % (N - l + 1); cout << "2 " << l << " " << r << "\n"; } } } freopen("seed", "w", stdout); cout << seed + 1 << endl; return 0; }
#include "Viruss.h" #include <iostream> #include <fstream> using namespace std; Viruss::Viruss() { this->m_dna = NULL; this->m_resistance = 0; } Viruss::Viruss(char *dna, int resistance) { this->m_dna = dna; this->m_resistance = resistance; } Viruss::Viruss(const Viruss * viruss) { this->m_dna = viruss->m_dna; this->m_resistance = viruss->m_resistance; } void Viruss::LoadADNInformation() { this->m_dna = NULL; ifstream inFile; inFile.open("ATGX.bin"); if (inFile.is_open()) { char *c = new char[100]; inFile >> c; this->m_dna = c; cout << "Load ADN success!" << endl; } else { cout << "Load error!" << endl; } inFile.close(); } int Viruss::ReduceResistance(int medicine_resistance) { this->m_resistance = this->m_resistance - medicine_resistance; return this->m_resistance; } int Viruss::GetResistance() { return this->m_resistance; } Viruss::~Viruss() { //delete[] this->m_dna; cout << "Destroy Virus" << endl; }
#include "AndroidFramework.h" #include "App_SSS.h" using namespace std; AndroidFramework::AndroidFramework(android_app *state) : app(state) { egl_service = new EGLService; app->onAppCmd = CommandHandler; app->onInputEvent = InputHandler; state->userData = this; Renderer = new App_SSS; } void AndroidFramework::Init() { print_log(ANDROID_LOG_DEBUG, "Startup"); Renderer->w = egl_service->width; Renderer->h = egl_service->height; Renderer->Init(); } AndroidFramework::~AndroidFramework() { egl_service->Shutdown(); delete egl_service; } void AndroidFramework::Run() { while (app->destroyRequested == 0) { android_poll_source *source; while (ALooper_pollAll(0, nullptr, nullptr, reinterpret_cast<void **>(&source)) >= 0) { if (source != nullptr) source->process(app, source); } if (!state_ok) continue; Renderer->Render(); egl_service->SwapBuffers(); } Shutdown(); print_log(ANDROID_LOG_DEBUG, "Shutdown"); } void AndroidFramework::Shutdown() { egl_service->Shutdown(); } void AndroidFramework::CommandHandler(struct android_app *state, int32_t cmd) { auto app = static_cast<AndroidFramework *>(state->userData); switch (cmd) { case APP_CMD_INIT_WINDOW: print_log(ANDROID_LOG_DEBUG, "Renderer resumed"); app->Init(); app->state_ok = true; break; case APP_CMD_TERM_WINDOW: print_log(ANDROID_LOG_DEBUG, "Renderer suspended"); break; } } int32_t AndroidFramework::InputHandler(struct android_app *state, AInputEvent *event) { return 0; }
/* * Values.h * * Created on: 21 Nov 2017 * Author: Riemann */ #include "Kontrolsystem.h" #ifndef VALUES_H_ #define VALUES_H_ using namespace std; class Values: public Kontrolsystem { public: //Values(double a, double b, double c, double d, double e) : light_val(a), temp_val(b), fert_val(c), hum_val(d), water_val(e){}; void getValues(double a, double b, double c, double d, double e); int intervalsHumidity(); int intervalsFertilizer(); int intervalsLight(); int intervalsTemperature(); private: double light_val; double temp_val; double fert_val; double hum_val; double water_val; }; #endif /* VALUES_H_ */
stock strtok(const string[], &index, delimiter = ' ') { new length = strlen(string); while ((index < length) && (string[index] <= delimiter)) { index++; } new offset = index; new result[128]; while ((index < length) && (string[index] > delimiter) && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } stock strrest(const string[], &index, delimiter = ' ') { new length = strlen(string); while ((index < length) && (string[index] <= delimiter)) { index++; } new offset = index; new result[128]; while ((index < length) && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } stock strcpy(dest[], const source[], len = sizeof(dest)) { dest[0] = '\0'; return strcat(dest, source, len); } stock strclr(string[]) { string[0] = '\0'; } stock bool:strempty(const string[]) { if (string[0] == '\0' || (string[0] == '\1' && string[1] == '\0')) return true; return false; } stock strcount(const string[], character) { new count = 0; for(new c = 0, length = strlen(string); c < length; c++) if (string[c] == character) count++; return count; } stock strtolower(string[]) { for(new c = 0, length = strlen(string); c < length; c++) string[c] = tolower(string[c]); } stock strtoupper(string[]) { for(new c = 0, length = strlen(string); c < length; c++) string[c] = toupper(string[c]); } static const MainString_CharacterWidths[] = { 0, 15, 15, 15, 15, 15, 15, 15, //NULL is not displayable because it breaks off the string, others display as a space 15, 15, 15, 15, 15, 15, 15, 15, //Display as a space 15, 15, 15, 15, 15, 15, 15, 15, //Display as a space 15, 15, 15, 15, 15, 15, 15, 15, //Display as a space 15, 9, 17, 27, 20, 34, 23, 12, // ! " £ $ % & ' 12, 12, 21, 20, 12, 14, 12, 15, //( ) * + , - . / 23, 15, 21, 21, 21, 21, 21, 21, //0 1 2 3 4 5 6 7 20, 21, 12, 12, 24, 24, 24, 19, //8 9 : ; < = > ? 10, 22, 19, 19, 22, 16, 19, 24, //tmA B C D E F G 22, 11, 16, 21, 15, 28, 24, 27, //H I J K L M N O 20, 25, 19, 19, 18, 23, 23, 31, //P Q R S T U V W 23, 19, 21, 21, 13, 35, 11, 21, //X Y Z ! _ 10, 19, 20, 14, 20, 19, 13, 20, //! a b c d e f g 19, 9, 9, 19, 9, 29, 19, 21, //h i j k l m n o 19, 19, 15, 15, 14, 18, 19, 27, //p q r s t u v w 20, 20, 17, 21, 17, 20, 15, 15, //x y z $ [ ] 22, 22, 22, 22, 29, 19, 16, 16, //À Á Â Ã Æ Ç È É 16, 16, 11, 11, 11, 11, 27, 27, //Ê Ë Ì Í Î Ï Ò Ó 27, 27, 23, 23, 23, 23, 20, 19, //Ô Ö Ù Ú Û Ü ß à 19, 19, 19, 30, 14, 19, 19, 19, //á â ã æ ç è é ê 19, 9, 9, 9, 9, 21, 21, 21, //ë ì í î ï ò ó ô 21, 18, 18, 18, 18, 24, 19, 19, //ö ù ú û ü Ñ ñ ¿ 20, 18, 19, 19, 21, 19, 19, 19, //0 1 2 3 4 5 6 7 19, 19, 16, 19, 19, 19, 20, 19, //8 9 : A B C D E 16, 19, 19, 9, 19, 20, 14, 29, //F G H I J K L M 19, 19, 19, 19, 19, 19, 21, 19, //N O P Q R S T U 20, 32, 21, 19, 19, 19, 19, 19, //V W X Y Z À Á Â 19, 29, 19, 19, 19, 19, 19, 9, //Ã Æ Ç È É Ê Ë Ì 9, 9, 9, 19, 19, 19, 19, 19, //Í Î Ï Ò Ó Ô Ö Ù 19, 19, 19, 19, 21, 19, 10, 9 //Ú Û Ü ß Ñ ¿ ' . }; stock GetCharacterWidth(c) { if (c < 0) return 0; if (c >= sizeof(MainString_CharacterWidths))return 20; return MainString_CharacterWidths[c]; } stock GetStringWidth(const string[]) { new width = 0; for(new c = 0, length = strlen(string); c < length; c++) width += GetCharacterWidth(string[c]); return width; } stock SpanishFix(const base[]) { new result[1024]; strcat(result, base); for (new i = (strlen(result) - 1); i != -1; --i) { switch (result[i]) { case 'à': result[i] = 151; case 'á': result[i] = 152; case 'â': result[i] = 153; case 'ä': result[i] = 154; case 'À': result[i] = 128; case 'Á': result[i] = 129; case 'Â': result[i] = 130; case 'Ä': result[i] = 131; case 'è': result[i] = 157; case 'é': result[i] = 158; case 'ê': result[i] = 159; case 'ë': result[i] = 160; case 'È': result[i] = 134; case 'É': result[i] = 135; case 'Ê': result[i] = 136; case 'Ë': result[i] = 137; case 'ì': result[i] = 161; case 'í': result[i] = 162; case 'î': result[i] = 163; case 'ï': result[i] = 164; case 'Ì': result[i] = 138; case 'Í': result[i] = 139; case 'Î': result[i] = 140; case 'Ï': result[i] = 141; case 'ò': result[i] = 165; case 'ó': result[i] = 166; case 'ô': result[i] = 167; case 'ö': result[i] = 168; case 'Ò': result[i] = 142; case 'Ó': result[i] = 143; case 'Ô': result[i] = 144; case 'Ö': result[i] = 145; case 'ù': result[i] = 169; case 'ú': result[i] = 170; case 'û': result[i] = 171; case 'ü': result[i] = 172; case 'Ù': result[i] = 146; case 'Ú': result[i] = 147; case 'Û': result[i] = 148; case 'Ü': result[i] = 149; case 'ñ': result[i] = 174; case 'Ñ': result[i] = 173; case '¡': result[i] = 64; case '¿': result[i] = 175; case '`': result[i] = 177; case '#': result[i] = 35; case '&': result[i] = 38; } } return result; } stock RandomString(strDest[], strLen = 10) { while(strLen --) strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0'); } stock atos(a[], size, s[], len = sizeof(s)) { s[0] = '['; for(new i; i < size; i++) { if(i != 0) strcat(s, ", ", len); format(s, len, "%s%d", s, a[i]); } s[strlen(s)] = ']'; } stock atosr(a[], size = sizeof(a)) { new s[256]; atos(a, size, s); return s; }
#ifndef METREE_H #define METREE_H #include "TTree.h" class TreeData { public: int ncommon_mem; double common_mem_p_bkg[1]; // double common_mem_p[1]; // double common_mem_blr_4b[1]; // double common_mem_blr_2b[1]; // double common_mem_p_sig[1]; // int nfatjets; double fatjets_phi[4]; // double fatjets_pt[4]; // double fatjets_tau1[4]; // double fatjets_tau2[4]; // double fatjets_tau3[4]; // double fatjets_eta[4]; // double fatjets_mass[4]; // double fatjets_bbtag[4]; // int nfw_aj; double fw_aj_fw_h_alljets_nominal[8]; // int nfw_bj; double fw_bj_fw_h_btagjets_nominal[8]; // int nfw_uj; double fw_uj_fw_h_untagjets_nominal[8]; // int ngenHiggs; double genHiggs_phi[2]; // double genHiggs_eta[2]; // double genHiggs_mass[2]; // double genHiggs_id[2]; // double genHiggs_pt[2]; // int ngenTopHad; double genTopHad_phi[2]; // double genTopHad_eta[2]; // double genTopHad_mass[2]; // double genTopHad_pt[2]; // double genTopHad_decayMode[2]; // int ngenTopLep; double genTopLep_phi[2]; // double genTopLep_eta[2]; // double genTopLep_mass[2]; // double genTopLep_pt[2]; // double genTopLep_decayMode[2]; // int nhiggsCandidate; double higgsCandidate_sj1eta_softdropfilt[4]; // double higgsCandidate_mass_softdrop[4]; //mass of the matched softdrop jet double higgsCandidate_sj2mass_pruned[4]; // double higgsCandidate_sj2pt_pruned[4]; // double higgsCandidate_sj2eta_softdropfilt[4]; // double higgsCandidate_sj2pt_softdropfilt[4]; // double higgsCandidate_sj2eta_softdropz2b1filt[4]; // double higgsCandidate_sj2mass_softdropfilt[4]; // double higgsCandidate_sj2mass_softdropz2b1filt[4]; // double higgsCandidate_sj2eta_softdrop[4]; // double higgsCandidate_sj2phi_pruned[4]; // double higgsCandidate_mass_softdropfilt[4]; //mass of the matched softdropfilt jet double higgsCandidate_sj1phi_softdrop[4]; // double higgsCandidate_sj1eta_subjetfiltered[4]; // double higgsCandidate_dr_top[4]; //deltaR to the best HTT candidate double higgsCandidate_sj1mass_softdropz2b1filt[4]; // double higgsCandidate_n_subjettiness[4]; // double higgsCandidate_sj2eta_softdropz2b1[4]; // double higgsCandidate_dr_genHiggs[4]; //deltaR to gen higgs double higgsCandidate_sj3pt_subjetfiltered[4]; // double higgsCandidate_sj2btag_softdropfilt[4]; // double higgsCandidate_sj2eta_pruned[4]; // double higgsCandidate_sj2pt_subjetfiltered[4]; // double higgsCandidate_sj2mass_subjetfiltered[4]; // double higgsCandidate_sj12masspt_subjetfiltered[4]; // double higgsCandidate_sj1pt_subjetfiltered[4]; // double higgsCandidate_sj2btag_softdropz2b1filt[4]; // double higgsCandidate_sj1pt_softdropfilt[4]; // double higgsCandidate_sj1phi_softdropfilt[4]; // double higgsCandidate_sj1mass_softdropz2b1[4]; // double higgsCandidate_nallsubjets_softdropz2b1filt[4]; // double higgsCandidate_dr_genTop[4]; //deltaR to closest gen top double higgsCandidate_nallsubjets_pruned[4]; // double higgsCandidate_sj1pt_softdropz2b1filt[4]; // double higgsCandidate_sj3btag_subjetfiltered[4]; // double higgsCandidate_sj2btag_subjetfiltered[4]; // double higgsCandidate_sj1btag_softdrop[4]; // double higgsCandidate_eta[4]; // double higgsCandidate_sj1btag_softdropfilt[4]; // double higgsCandidate_nallsubjets_softdropfilt[4]; // double higgsCandidate_sj12massb_subjetfiltered[4]; // double higgsCandidate_sj1phi_pruned[4]; // double higgsCandidate_sj2pt_softdrop[4]; // double higgsCandidate_sj3phi_subjetfiltered[4]; // double higgsCandidate_sj2mass_softdrop[4]; // double higgsCandidate_sj1pt_pruned[4]; // double higgsCandidate_mass_softdropz2b1filt[4]; //mass of the matched softdropz2b1filt jet double higgsCandidate_sj1eta_pruned[4]; // double higgsCandidate_sj1phi_subjetfiltered[4]; // double higgsCandidate_mass_pruned[4]; //mass of the matched pruned jet double higgsCandidate_pt[4]; // double higgsCandidate_sj1eta_softdropz2b1filt[4]; // double higgsCandidate_nallsubjets_softdropz2b1[4]; // double higgsCandidate_sj1pt_softdrop[4]; // double higgsCandidate_tau2[4]; // double higgsCandidate_tau3[4]; // double higgsCandidate_sj3eta_subjetfiltered[4]; // double higgsCandidate_tau1[4]; // double higgsCandidate_nallsubjets_softdrop[4]; // double higgsCandidate_sj2btag_pruned[4]; // double higgsCandidate_sj1eta_softdrop[4]; // double higgsCandidate_sj1btag_softdropz2b1filt[4]; // double higgsCandidate_sj2mass_softdropz2b1[4]; // double higgsCandidate_nallsubjets_subjetfiltered[4]; // double higgsCandidate_sj2pt_softdropz2b1[4]; // double higgsCandidate_sj2pt_softdropz2b1filt[4]; // double higgsCandidate_sj2phi_softdropz2b1[4]; // double higgsCandidate_sj2phi_softdropz2b1filt[4]; // double higgsCandidate_sj1mass_pruned[4]; // double higgsCandidate_sj1pt_softdropz2b1[4]; // double higgsCandidate_sj1mass_softdrop[4]; // double higgsCandidate_sj1btag_softdropz2b1[4]; // double higgsCandidate_sj1btag_subjetfiltered[4]; // double higgsCandidate_sj1eta_softdropz2b1[4]; // double higgsCandidate_sj2eta_subjetfiltered[4]; // double higgsCandidate_secondbtag_subjetfiltered[4]; // double higgsCandidate_sj2btag_softdrop[4]; // double higgsCandidate_sj2phi_softdropfilt[4]; // double higgsCandidate_sj3mass_subjetfiltered[4]; // double higgsCandidate_sj1mass_subjetfiltered[4]; // double higgsCandidate_sj1btag_pruned[4]; // double higgsCandidate_sj2phi_subjetfiltered[4]; // double higgsCandidate_sj123masspt_subjetfiltered[4]; // double higgsCandidate_phi[4]; // double higgsCandidate_sj1mass_softdropfilt[4]; // double higgsCandidate_sj2phi_softdrop[4]; // double higgsCandidate_sj1phi_softdropz2b1[4]; // double higgsCandidate_sj1phi_softdropz2b1filt[4]; // double higgsCandidate_mass[4]; // double higgsCandidate_sj2btag_softdropz2b1[4]; // double higgsCandidate_bbtag[4]; // double higgsCandidate_mass_softdropz2b1[4]; //mass of the matched softdropz2b1 jet int njets; double jets_mcPt[16]; // double jets_mcEta[16]; // double jets_btagCMVA[16]; // double jets_id[16]; // double jets_btagFlag[16]; //Jet was considered to be a b in MEM according to the algo double jets_pt[16]; // double jets_corr_JERDown[16]; // double jets_qgl[16]; // double jets_mcPhi[16]; // double jets_mcNumCHadrons[16]; // int jets_matchFlag[16]; //0 - matched to light quark from W, 1 - matched to b form top, 2 - matched to b from higgs double jets_phi[16]; // int jets_matchBfromHadT[16]; // int jets_hadronFlavour[16]; // double jets_corr_JESUp[16]; // double jets_corr_JERUp[16]; // double jets_corr[16]; // double jets_corr_JER[16]; // double jets_corr_JESDown[16]; // double jets_mcM[16]; // double jets_btagCSV[16]; // int jets_mcMatchId[16]; // double jets_btagCMVA_log[16]; //log-transformed btagCMVA double jets_mcNumBHadrons[16]; // double jets_eta[16]; // double jets_mass[16]; // int jets_mcFlavour[16]; // int nleps; double leps_phi[2]; // double leps_pt[2]; // double leps_pdgId[2]; // double leps_relIso04[2]; // double leps_eta[2]; // double leps_mass[2]; // double leps_relIso03[2]; // double leps_mvaId[2]; // int nloose_jets; double loose_jets_mcPt[6]; // double loose_jets_mcEta[6]; // double loose_jets_btagCMVA[6]; // double loose_jets_id[6]; // double loose_jets_btagFlag[6]; //Jet was considered to be a b in MEM according to the algo double loose_jets_pt[6]; // double loose_jets_corr_JERDown[6]; // double loose_jets_qgl[6]; // double loose_jets_mcPhi[6]; // double loose_jets_mcNumCHadrons[6]; // int loose_jets_matchFlag[6]; //0 - matched to light quark from W, 1 - matched to b form top, 2 - matched to b from higgs double loose_jets_phi[6]; // int loose_jets_matchBfromHadT[6]; // int loose_jets_hadronFlavour[6]; // double loose_jets_corr_JESUp[6]; // double loose_jets_corr_JERUp[6]; // double loose_jets_corr[6]; // double loose_jets_corr_JER[6]; // double loose_jets_corr_JESDown[6]; // double loose_jets_mcM[6]; // double loose_jets_btagCSV[6]; // int loose_jets_mcMatchId[6]; // double loose_jets_btagCMVA_log[6]; //log-transformed btagCMVA double loose_jets_mcNumBHadrons[6]; // double loose_jets_eta[6]; // double loose_jets_mass[6]; // int loose_jets_mcFlavour[6]; // double mem_ttbb_DL_0w2h2t_perm_p_me_mean[50]; // double mem_ttbb_DL_0w2h2t_perm_p_me_std[50]; // double mem_ttbb_DL_0w2h2t_perm_p_mean[50]; // double mem_ttbb_DL_0w2h2t_perm_p_std[50]; // double mem_ttbb_DL_0w2h2t_perm_p_tf_mean[50]; // double mem_ttbb_DL_0w2h2t_perm_p_tf_std[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_0[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_1[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_2[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_3[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_4[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_5[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_6[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_7[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_8[50]; // double mem_ttbb_DL_0w2h2t_perm_perm_9[50]; // double mem_ttbb_SL_0w2h2t_perm_p_me_mean[50]; // double mem_ttbb_SL_0w2h2t_perm_p_me_std[50]; // double mem_ttbb_SL_0w2h2t_perm_p_mean[50]; // double mem_ttbb_SL_0w2h2t_perm_p_std[50]; // double mem_ttbb_SL_0w2h2t_perm_p_tf_mean[50]; // double mem_ttbb_SL_0w2h2t_perm_p_tf_std[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_0[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_1[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_2[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_3[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_4[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_5[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_6[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_7[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_8[50]; // double mem_ttbb_SL_0w2h2t_perm_perm_9[50]; // double mem_ttbb_SL_1w2h2t_perm_p_me_mean[50]; // double mem_ttbb_SL_1w2h2t_perm_p_me_std[50]; // double mem_ttbb_SL_1w2h2t_perm_p_mean[50]; // double mem_ttbb_SL_1w2h2t_perm_p_std[50]; // double mem_ttbb_SL_1w2h2t_perm_p_tf_mean[50]; // double mem_ttbb_SL_1w2h2t_perm_p_tf_std[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_0[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_1[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_2[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_3[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_4[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_5[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_6[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_7[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_8[50]; // double mem_ttbb_SL_1w2h2t_perm_perm_9[50]; // double mem_ttbb_SL_2w2h2t_perm_p_me_mean[50]; // double mem_ttbb_SL_2w2h2t_perm_p_me_std[50]; // double mem_ttbb_SL_2w2h2t_perm_p_mean[50]; // double mem_ttbb_SL_2w2h2t_perm_p_std[50]; // double mem_ttbb_SL_2w2h2t_perm_p_tf_mean[50]; // double mem_ttbb_SL_2w2h2t_perm_p_tf_std[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_0[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_1[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_2[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_3[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_4[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_5[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_6[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_7[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_8[50]; // double mem_ttbb_SL_2w2h2t_perm_perm_9[50]; // double mem_tth_DL_0w2h2t_perm_p_me_mean[50]; // double mem_tth_DL_0w2h2t_perm_p_me_std[50]; // double mem_tth_DL_0w2h2t_perm_p_mean[50]; // double mem_tth_DL_0w2h2t_perm_p_std[50]; // double mem_tth_DL_0w2h2t_perm_p_tf_mean[50]; // double mem_tth_DL_0w2h2t_perm_p_tf_std[50]; // double mem_tth_DL_0w2h2t_perm_perm_0[50]; // double mem_tth_DL_0w2h2t_perm_perm_1[50]; // double mem_tth_DL_0w2h2t_perm_perm_2[50]; // double mem_tth_DL_0w2h2t_perm_perm_3[50]; // double mem_tth_DL_0w2h2t_perm_perm_4[50]; // double mem_tth_DL_0w2h2t_perm_perm_5[50]; // double mem_tth_DL_0w2h2t_perm_perm_6[50]; // double mem_tth_DL_0w2h2t_perm_perm_7[50]; // double mem_tth_DL_0w2h2t_perm_perm_8[50]; // double mem_tth_DL_0w2h2t_perm_perm_9[50]; // double mem_tth_SL_0w2h2t_perm_p_me_mean[50]; // double mem_tth_SL_0w2h2t_perm_p_me_std[50]; // double mem_tth_SL_0w2h2t_perm_p_mean[50]; // double mem_tth_SL_0w2h2t_perm_p_std[50]; // double mem_tth_SL_0w2h2t_perm_p_tf_mean[50]; // double mem_tth_SL_0w2h2t_perm_p_tf_std[50]; // double mem_tth_SL_0w2h2t_perm_perm_0[50]; // double mem_tth_SL_0w2h2t_perm_perm_1[50]; // double mem_tth_SL_0w2h2t_perm_perm_2[50]; // double mem_tth_SL_0w2h2t_perm_perm_3[50]; // double mem_tth_SL_0w2h2t_perm_perm_4[50]; // double mem_tth_SL_0w2h2t_perm_perm_5[50]; // double mem_tth_SL_0w2h2t_perm_perm_6[50]; // double mem_tth_SL_0w2h2t_perm_perm_7[50]; // double mem_tth_SL_0w2h2t_perm_perm_8[50]; // double mem_tth_SL_0w2h2t_perm_perm_9[50]; // double mem_tth_SL_1w2h2t_perm_p_me_mean[50]; // double mem_tth_SL_1w2h2t_perm_p_me_std[50]; // double mem_tth_SL_1w2h2t_perm_p_mean[50]; // double mem_tth_SL_1w2h2t_perm_p_std[50]; // double mem_tth_SL_1w2h2t_perm_p_tf_mean[50]; // double mem_tth_SL_1w2h2t_perm_p_tf_std[50]; // double mem_tth_SL_1w2h2t_perm_perm_0[50]; // double mem_tth_SL_1w2h2t_perm_perm_1[50]; // double mem_tth_SL_1w2h2t_perm_perm_2[50]; // double mem_tth_SL_1w2h2t_perm_perm_3[50]; // double mem_tth_SL_1w2h2t_perm_perm_4[50]; // double mem_tth_SL_1w2h2t_perm_perm_5[50]; // double mem_tth_SL_1w2h2t_perm_perm_6[50]; // double mem_tth_SL_1w2h2t_perm_perm_7[50]; // double mem_tth_SL_1w2h2t_perm_perm_8[50]; // double mem_tth_SL_1w2h2t_perm_perm_9[50]; // double mem_tth_SL_2w2h2t_perm_p_me_mean[50]; // double mem_tth_SL_2w2h2t_perm_p_me_std[50]; // double mem_tth_SL_2w2h2t_perm_p_mean[50]; // double mem_tth_SL_2w2h2t_perm_p_std[50]; // double mem_tth_SL_2w2h2t_perm_p_tf_mean[50]; // double mem_tth_SL_2w2h2t_perm_p_tf_std[50]; // double mem_tth_SL_2w2h2t_perm_perm_0[50]; // double mem_tth_SL_2w2h2t_perm_perm_1[50]; // double mem_tth_SL_2w2h2t_perm_perm_2[50]; // double mem_tth_SL_2w2h2t_perm_perm_3[50]; // double mem_tth_SL_2w2h2t_perm_perm_4[50]; // double mem_tth_SL_2w2h2t_perm_perm_5[50]; // double mem_tth_SL_2w2h2t_perm_perm_6[50]; // double mem_tth_SL_2w2h2t_perm_perm_7[50]; // double mem_tth_SL_2w2h2t_perm_perm_8[50]; // double mem_tth_SL_2w2h2t_perm_perm_9[50]; // int mem_ttbb_DL_0w2h2t_perm_idx[50]; // int mem_ttbb_SL_0w2h2t_perm_idx[50]; // int mem_ttbb_SL_1w2h2t_perm_idx[50]; // int mem_ttbb_SL_2w2h2t_perm_idx[50]; // int mem_tth_DL_0w2h2t_perm_idx[50]; // int mem_tth_SL_0w2h2t_perm_idx[50]; // int mem_tth_SL_1w2h2t_perm_idx[50]; // int mem_tth_SL_2w2h2t_perm_idx[50]; // int nmem_ttbb_DL_0w2h2t_perm; int nmem_ttbb_SL_0w2h2t_perm; int nmem_ttbb_SL_1w2h2t_perm; int nmem_ttbb_SL_2w2h2t_perm; int nmem_tth_DL_0w2h2t_perm; int nmem_tth_SL_0w2h2t_perm; int nmem_tth_SL_1w2h2t_perm; int nmem_tth_SL_2w2h2t_perm; int nothertopCandidate; double othertopCandidate_tau1[4]; // double othertopCandidate_etacal[4]; // double othertopCandidate_sjW2btag[4]; // double othertopCandidate_n_subjettiness_groomed[4]; // double othertopCandidate_sjW2pt[4]; // double othertopCandidate_sjW1ptcal[4]; // double othertopCandidate_sjW1btag[4]; // double othertopCandidate_sjW1mass[4]; // double othertopCandidate_sjNonWmass[4]; // double othertopCandidate_sjNonWptcal[4]; // double othertopCandidate_sjNonWeta[4]; // double othertopCandidate_pt[4]; // double othertopCandidate_sjW2masscal[4]; // double othertopCandidate_ptForRoptCalc[4]; // double othertopCandidate_tau2[4]; // double othertopCandidate_phi[4]; // double othertopCandidate_tau3[4]; // double othertopCandidate_sjNonWpt[4]; // double othertopCandidate_sjNonWmasscal[4]; // double othertopCandidate_sjW1masscal[4]; // double othertopCandidate_sjW2mass[4]; // double othertopCandidate_mass[4]; // double othertopCandidate_sjNonWbtag[4]; // double othertopCandidate_Ropt[4]; // double othertopCandidate_RoptCalc[4]; // double othertopCandidate_masscal[4]; // double othertopCandidate_ptcal[4]; // double othertopCandidate_sjW1phi[4]; // double othertopCandidate_sjW1pt[4]; // double othertopCandidate_sjNonWphi[4]; // double othertopCandidate_delRopt[4]; // double othertopCandidate_sjW1eta[4]; // double othertopCandidate_fRec[4]; // double othertopCandidate_phical[4]; // double othertopCandidate_sjW2phi[4]; // double othertopCandidate_eta[4]; // double othertopCandidate_n_subjettiness[4]; // double othertopCandidate_sjW2ptcal[4]; // double othertopCandidate_bbtag[4]; // double othertopCandidate_sjW2eta[4]; // double othertopCandidate_genTopHad_dr[4]; //DeltaR to the closest hadronic gen top int ntopCandidate; double topCandidate_tau1[1]; // double topCandidate_etacal[1]; // double topCandidate_sjW2btag[1]; // double topCandidate_n_subjettiness_groomed[1]; // double topCandidate_sjW2pt[1]; // double topCandidate_sjW1ptcal[1]; // double topCandidate_sjW1btag[1]; // double topCandidate_sjW1mass[1]; // double topCandidate_sjNonWmass[1]; // double topCandidate_sjNonWptcal[1]; // double topCandidate_sjNonWeta[1]; // double topCandidate_pt[1]; // double topCandidate_sjW2masscal[1]; // double topCandidate_ptForRoptCalc[1]; // double topCandidate_tau2[1]; // double topCandidate_phi[1]; // double topCandidate_tau3[1]; // double topCandidate_sjNonWpt[1]; // double topCandidate_sjNonWmasscal[1]; // double topCandidate_sjW1masscal[1]; // double topCandidate_sjW2mass[1]; // double topCandidate_mass[1]; // double topCandidate_sjNonWbtag[1]; // double topCandidate_Ropt[1]; // double topCandidate_RoptCalc[1]; // double topCandidate_masscal[1]; // double topCandidate_ptcal[1]; // double topCandidate_sjW1phi[1]; // double topCandidate_sjW1pt[1]; // double topCandidate_sjNonWphi[1]; // double topCandidate_delRopt[1]; // double topCandidate_sjW1eta[1]; // double topCandidate_fRec[1]; // double topCandidate_phical[1]; // double topCandidate_sjW2phi[1]; // double topCandidate_eta[1]; // double topCandidate_n_subjettiness[1]; // double topCandidate_sjW2ptcal[1]; // double topCandidate_bbtag[1]; // double topCandidate_sjW2eta[1]; // double topCandidate_genTopHad_dr[1]; //DeltaR to the closest hadronic gen top int ntopCandidatesSync; double topCandidatesSync_tau1[4]; // double topCandidatesSync_etacal[4]; // double topCandidatesSync_sjW2btag[4]; // double topCandidatesSync_n_subjettiness_groomed[4]; // double topCandidatesSync_sjW2pt[4]; // double topCandidatesSync_sjW1ptcal[4]; // double topCandidatesSync_sjW1btag[4]; // double topCandidatesSync_sjW1mass[4]; // double topCandidatesSync_sjNonWmass[4]; // double topCandidatesSync_sjNonWptcal[4]; // double topCandidatesSync_sjNonWeta[4]; // double topCandidatesSync_pt[4]; // double topCandidatesSync_sjW2masscal[4]; // double topCandidatesSync_ptForRoptCalc[4]; // double topCandidatesSync_tau2[4]; // double topCandidatesSync_phi[4]; // double topCandidatesSync_tau3[4]; // double topCandidatesSync_sjNonWpt[4]; // double topCandidatesSync_sjNonWmasscal[4]; // double topCandidatesSync_sjW1masscal[4]; // double topCandidatesSync_sjW2mass[4]; // double topCandidatesSync_mass[4]; // double topCandidatesSync_sjNonWbtag[4]; // double topCandidatesSync_Ropt[4]; // double topCandidatesSync_RoptCalc[4]; // double topCandidatesSync_masscal[4]; // double topCandidatesSync_ptcal[4]; // double topCandidatesSync_sjW1phi[4]; // double topCandidatesSync_sjW1pt[4]; // double topCandidatesSync_sjNonWphi[4]; // double topCandidatesSync_delRopt[4]; // double topCandidatesSync_sjW1eta[4]; // double topCandidatesSync_fRec[4]; // double topCandidatesSync_phical[4]; // double topCandidatesSync_sjW2phi[4]; // double topCandidatesSync_eta[4]; // double topCandidatesSync_n_subjettiness[4]; // double topCandidatesSync_sjW2ptcal[4]; // double topCandidatesSync_bbtag[4]; // double topCandidatesSync_sjW2eta[4]; // double topCandidatesSync_genTopHad_dr[4]; //DeltaR to the closest hadronic gen top int nll; double ll_phi[1]; // double ll_eta[1]; // double ll_mass[1]; // double ll_pt[1]; // int nmem_ttbb_DL_0w2h2t; double mem_ttbb_DL_0w2h2t_p[1]; // double mem_ttbb_DL_0w2h2t_chi2[1]; // double mem_ttbb_DL_0w2h2t_p_err[1]; // double mem_ttbb_DL_0w2h2t_efficiency[1]; // int mem_ttbb_DL_0w2h2t_nperm[1]; // double mem_ttbb_DL_0w2h2t_time[1]; // int mem_ttbb_DL_0w2h2t_error_code[1]; // int nmem_ttbb_SL_0w2h2t; double mem_ttbb_SL_0w2h2t_p[1]; // double mem_ttbb_SL_0w2h2t_chi2[1]; // double mem_ttbb_SL_0w2h2t_p_err[1]; // double mem_ttbb_SL_0w2h2t_efficiency[1]; // int mem_ttbb_SL_0w2h2t_nperm[1]; // double mem_ttbb_SL_0w2h2t_time[1]; // int mem_ttbb_SL_0w2h2t_error_code[1]; // int nmem_ttbb_SL_1w2h2t; double mem_ttbb_SL_1w2h2t_p[1]; // double mem_ttbb_SL_1w2h2t_chi2[1]; // double mem_ttbb_SL_1w2h2t_p_err[1]; // double mem_ttbb_SL_1w2h2t_efficiency[1]; // int mem_ttbb_SL_1w2h2t_nperm[1]; // double mem_ttbb_SL_1w2h2t_time[1]; // int mem_ttbb_SL_1w2h2t_error_code[1]; // int nmem_ttbb_SL_2w2h2t; double mem_ttbb_SL_2w2h2t_p[1]; // double mem_ttbb_SL_2w2h2t_chi2[1]; // double mem_ttbb_SL_2w2h2t_p_err[1]; // double mem_ttbb_SL_2w2h2t_efficiency[1]; // int mem_ttbb_SL_2w2h2t_nperm[1]; // double mem_ttbb_SL_2w2h2t_time[1]; // int mem_ttbb_SL_2w2h2t_error_code[1]; // int nmem_tth_DL_0w2h2t; double mem_tth_DL_0w2h2t_p[1]; // double mem_tth_DL_0w2h2t_chi2[1]; // double mem_tth_DL_0w2h2t_p_err[1]; // double mem_tth_DL_0w2h2t_efficiency[1]; // int mem_tth_DL_0w2h2t_nperm[1]; // double mem_tth_DL_0w2h2t_time[1]; // int mem_tth_DL_0w2h2t_error_code[1]; // int nmem_tth_SL_0w2h2t; double mem_tth_SL_0w2h2t_p[1]; // double mem_tth_SL_0w2h2t_chi2[1]; // double mem_tth_SL_0w2h2t_p_err[1]; // double mem_tth_SL_0w2h2t_efficiency[1]; // int mem_tth_SL_0w2h2t_nperm[1]; // double mem_tth_SL_0w2h2t_time[1]; // int mem_tth_SL_0w2h2t_error_code[1]; // int nmem_tth_SL_1w2h2t; double mem_tth_SL_1w2h2t_p[1]; // double mem_tth_SL_1w2h2t_chi2[1]; // double mem_tth_SL_1w2h2t_p_err[1]; // double mem_tth_SL_1w2h2t_efficiency[1]; // int mem_tth_SL_1w2h2t_nperm[1]; // double mem_tth_SL_1w2h2t_time[1]; // int mem_tth_SL_1w2h2t_error_code[1]; // int nmem_tth_SL_2w2h2t; double mem_tth_SL_2w2h2t_p[1]; // double mem_tth_SL_2w2h2t_chi2[1]; // double mem_tth_SL_2w2h2t_p_err[1]; // double mem_tth_SL_2w2h2t_efficiency[1]; // int mem_tth_SL_2w2h2t_nperm[1]; // double mem_tth_SL_2w2h2t_time[1]; // int mem_tth_SL_2w2h2t_error_code[1]; // int nmet; double met_phi[1]; // double met_sumEt[1]; // double met_pt[1]; // double met_px[1]; // double met_py[1]; // double met_genPhi[1]; // double met_genPt[1]; // int nmet_gen; double met_gen_phi[1]; // double met_gen_sumEt[1]; // double met_gen_pt[1]; // double met_gen_px[1]; // double met_gen_py[1]; // double met_gen_genPhi[1]; // double met_gen_genPt[1]; // int nmet_jetcorr; double met_jetcorr_phi[1]; // double met_jetcorr_sumEt[1]; // double met_jetcorr_pt[1]; // double met_jetcorr_px[1]; // double met_jetcorr_py[1]; // double met_jetcorr_genPhi[1]; // double met_jetcorr_genPt[1]; // int nmet_ttbar_gen; double met_ttbar_gen_phi[1]; // double met_ttbar_gen_sumEt[1]; // double met_ttbar_gen_pt[1]; // double met_ttbar_gen_px[1]; // double met_ttbar_gen_py[1]; // double met_ttbar_gen_genPhi[1]; // double met_ttbar_gen_genPt[1]; // int npv; double pv_z[1]; // double pv_isFake[1]; // double pv_rho[1]; // double pv_ndof[1]; // double C; double D; int HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV0p45_v; int HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV_p20_v; int HLT_BIT_HLT_AK8DiPFJet280_200_TrimMass30_BTagCSV0p45_v; int HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV0p45_v; int HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV_p20_v; int HLT_BIT_HLT_AK8PFHT650_TrimR0p1PT0p03Mass50_v; int HLT_BIT_HLT_AK8PFHT700_TrimR0p1PT0p03Mass50_v; int HLT_BIT_HLT_AK8PFJet360_TrimMass30_v; int HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV0p72_v; int HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV_p067_v; int HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_v; int HLT_BIT_HLT_DiCentralPFJet55_PFMET110_NoiseCleaned_v; int HLT_BIT_HLT_DiCentralPFJet55_PFMET110_v; int HLT_BIT_HLT_DiPFJetAve140_v; int HLT_BIT_HLT_DiPFJetAve200_v; int HLT_BIT_HLT_DiPFJetAve260_v; int HLT_BIT_HLT_DiPFJetAve320_v; int HLT_BIT_HLT_DiPFJetAve40_v; int HLT_BIT_HLT_DiPFJetAve60_v; int HLT_BIT_HLT_DiPFJetAve80_v; int HLT_BIT_HLT_DoubleEle24_22_eta2p1_WPLoose_Gsf_v; int HLT_BIT_HLT_DoubleIsoMu17_eta2p1_v; int HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV0p67_v; int HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV_p087_v; int HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV0p67_v; int HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV_p087_v; int HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p85_DoublePFJetsC160_v; int HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p9_DoublePFJetsC100MaxDeta1p6_v; int HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p014_DoublePFJetsC100MaxDeta1p6_v; int HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p026_DoublePFJetsC160_v; int HLT_BIT_HLT_Ele105_CaloIdVT_GsfTrkIdT_v; int HLT_BIT_HLT_Ele12_CaloIdL_TrackIdL_IsoVL_v; int HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v; int HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_v; int HLT_BIT_HLT_Ele22_eta2p1_WPLoose_Gsf_v; int HLT_BIT_HLT_Ele22_eta2p1_WPTight_Gsf_v; int HLT_BIT_HLT_Ele23_CaloIdL_TrackIdL_IsoVL_v; int HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v; int HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_v; int HLT_BIT_HLT_Ele23_WPLoose_Gsf_WHbbBoost_v; int HLT_BIT_HLT_Ele23_WPLoose_Gsf_v; int HLT_BIT_HLT_Ele25_WPTight_Gsf_v; int HLT_BIT_HLT_Ele25_eta2p1_WPLoose_Gsf_v; int HLT_BIT_HLT_Ele27_WPLoose_Gsf_WHbbBoost_v; int HLT_BIT_HLT_Ele27_WPLoose_Gsf_v; int HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v; int HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_HT200_v; int HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_v; int HLT_BIT_HLT_Ele27_eta2p1_WPTight_Gsf_v; int HLT_BIT_HLT_Ele30WP60_Ele8_Mass55_v; int HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v; int HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_v; int HLT_BIT_HLT_Ele45_CaloIdVT_GsfTrkIdT_PFJet200_PFJet50_v; int HLT_BIT_HLT_IsoMu16_eta2p1_CaloMET30_v; int HLT_BIT_HLT_IsoMu18_v; int HLT_BIT_HLT_IsoMu20_eta2p1_CentralPFJet30_BTagCSV07_v; int HLT_BIT_HLT_IsoMu20_eta2p1_v; int HLT_BIT_HLT_IsoMu20_v; int HLT_BIT_HLT_IsoMu24_eta2p1_CentralPFJet30_BTagCSV07_v; int HLT_BIT_HLT_IsoMu24_eta2p1_v; int HLT_BIT_HLT_IsoMu27_v; int HLT_BIT_HLT_IsoTkMu18_v; int HLT_BIT_HLT_IsoTkMu20_v; int HLT_BIT_HLT_IsoTkMu27_v; int HLT_BIT_HLT_L1_TripleJet_VBF_v; int HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET120_v; int HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET80_v; int HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_v; int HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v; int HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v; int HLT_BIT_HLT_Mu16_eta2p1_CaloMET30_v; int HLT_BIT_HLT_Mu17_TkMu8_DZ_v; int HLT_BIT_HLT_Mu17_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v; int HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v; int HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v; int HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_DZ_v; int HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_v; int HLT_BIT_HLT_Mu20_v; int HLT_BIT_HLT_Mu24_eta2p1_v; int HLT_BIT_HLT_Mu24_v; int HLT_BIT_HLT_Mu27_v; int HLT_BIT_HLT_Mu40_eta2p1_PFJet200_PFJet50_v; int HLT_BIT_HLT_Mu8_TrkIsoVVL_Ele17_CaloIdL_TrackIdL_IsoVL_v; int HLT_BIT_HLT_OldIsoMu18_v; int HLT_BIT_HLT_OldIsoTkMu18_v; int HLT_BIT_HLT_PFHT350_PFMET100_NoiseCleaned_v; int HLT_BIT_HLT_PFHT350_PFMET100_v; int HLT_BIT_HLT_PFHT350_v; int HLT_BIT_HLT_PFHT400_SixJet30_BTagCSV0p55_2PFBTagCSV0p72_v; int HLT_BIT_HLT_PFHT400_SixJet30_DoubleBTagCSV_p056_v; int HLT_BIT_HLT_PFHT400_SixJet30_v; int HLT_BIT_HLT_PFHT450_SixJet40_BTagCSV_p056_v; int HLT_BIT_HLT_PFHT450_SixJet40_PFBTagCSV0p72_v; int HLT_BIT_HLT_PFHT450_SixJet40_v; int HLT_BIT_HLT_PFHT650_WideJetMJJ900DEtaJJ1p5_v; int HLT_BIT_HLT_PFHT650_WideJetMJJ950DEtaJJ1p5_v; int HLT_BIT_HLT_PFHT750_4JetPt50_v; int HLT_BIT_HLT_PFHT800_v; int HLT_BIT_HLT_PFJet140_v; int HLT_BIT_HLT_PFJet200_v; int HLT_BIT_HLT_PFJet260_v; int HLT_BIT_HLT_PFJet320_v; int HLT_BIT_HLT_PFJet400_v; int HLT_BIT_HLT_PFJet40_v; int HLT_BIT_HLT_PFJet450_v; int HLT_BIT_HLT_PFJet60_v; int HLT_BIT_HLT_PFJet80_v; int HLT_BIT_HLT_PFMET100_PFMHT100_IDTight_v; int HLT_BIT_HLT_PFMET110_PFMHT110_IDTight_v; int HLT_BIT_HLT_PFMET120_NoiseCleaned_Mu5_v; int HLT_BIT_HLT_PFMET120_PFMHT120_IDTight_v; int HLT_BIT_HLT_PFMET170_NoiseCleaned_v; int HLT_BIT_HLT_PFMET90_PFMHT90_IDTight_v; int HLT_BIT_HLT_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v; int HLT_BIT_HLT_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v; int HLT_BIT_HLT_QuadJet45_DoubleBTagCSV0p67_v; int HLT_BIT_HLT_QuadJet45_DoubleBTagCSV_p087_v; int HLT_BIT_HLT_QuadJet45_TripleBTagCSV0p67_v; int HLT_BIT_HLT_QuadJet45_TripleBTagCSV_p087_v; int HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq460_v; int HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq500_v; int HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq200_v; int HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq240_v; int HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq200_v; int HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq240_v; int HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq460_v; int HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq500_v; int HLT_BIT_HLT_QuadPFJet_VBF_v; int HLT_BIT_HLT_TkMu20_v; int HLT_BIT_HLT_TkMu24_eta2p1_v; int HLT_BIT_HLT_TkMu27_v; int HLT_HH4bAll; int HLT_HH4bHighLumi; int HLT_HH4bLowLumi; int HLT_VBFHbbAll; int HLT_VBFHbbHighLumi; int HLT_VBFHbbLowLumi; int HLT_WenHbbAll; int HLT_WenHbbHighLumi; int HLT_WenHbbLowLumi; int HLT_WmnHbbAll; int HLT_WmnHbbHighLumi; int HLT_WmnHbbLowLumi; int HLT_WtaunHbbAll; int HLT_WtaunHbbHighLumi; int HLT_WtaunHbbLowLumi; int HLT_ZeeHbbAll; int HLT_ZeeHbbHighLumi; int HLT_ZeeHbbLowLumi; int HLT_ZmmHbbAll; int HLT_ZmmHbbHighLumi; int HLT_ZmmHbbLowLumi; int HLT_ZnnHbb; int HLT_ZnnHbbAll; int HLT_hadronic; int HLT_ttHhardonicAll; int HLT_ttHhardonicHighLumi; int HLT_ttHhardonicLowLumi; int HLT_ttHleptonic; double Wmass; double aplanarity; double bTagWeight; double bTagWeight_HFDown; double bTagWeight_HFStats1Down; double bTagWeight_HFStats1Up; double bTagWeight_HFStats2Down; double bTagWeight_HFStats2Up; double bTagWeight_HFUp; double bTagWeight_JESDown; double bTagWeight_JESUp; double bTagWeight_LFDown; double bTagWeight_LFStats1Down; double bTagWeight_LFStats1Up; double bTagWeight_LFStats2Down; double bTagWeight_LFStats2Up; double bTagWeight_LFUp; double bTagWeight_cErr1Down; double bTagWeight_cErr1Up; double bTagWeight_cErr2Down; double bTagWeight_cErr2Up; double btag_LR_4b_2b_btagCMVA; double btag_LR_4b_2b_btagCMVA_log; double btag_LR_4b_2b_btagCSV; double btag_lr_2b; double btag_lr_4b; int cat; int cat_btag; int cat_gen; double common_bdt; double common_bdt_withmem1; double common_bdt_withmem2; double eta_drpair_btag; long evt; int genHiggsDecayMode; double genWeight; double ht; int is_dl; int is_fh; int is_sl; double isotropy; double json; long lumi; double mass_drpair_btag; double mean_bdisc; double mean_bdisc_btag; double mean_dr_btag; double min_dr_btag; double momentum_eig0; double momentum_eig1; double momentum_eig2; int nBCMVAL; int nBCMVAM; int nBCMVAT; int nBCSVL; int nBCSVM; int nBCSVT; int nGenBHiggs; int nGenBTop; int nGenQW; int nMatchSimB; int nMatchSimC; int nMatch_hb; int nMatch_hb_btag; int nMatch_tb; int nMatch_tb_btag; int nMatch_wq; int nMatch_wq_btag; double nPU0; double nPVs; int nSelected_hb; int nSelected_tb; int nSelected_wq; double nTrueInt; double n_bjets; double n_boosted_bjets; double n_boosted_ljets; double n_excluded_bjets; double n_excluded_ljets; double n_ljets; int numJets; int passPV; int passes_btag; int passes_jet; int passes_mem; double pt_drpair_btag; double puWeight; double qg_LR_flavour_4q_0q; double qg_LR_flavour_4q_0q_1q; double qg_LR_flavour_4q_0q_1q_2q; double qg_LR_flavour_4q_0q_1q_2q_3q; double qg_LR_flavour_4q_1q; double qg_LR_flavour_4q_1q_2q; double qg_LR_flavour_4q_1q_2q_3q; double qg_LR_flavour_4q_2q; double qg_LR_flavour_4q_2q_3q; double qg_LR_flavour_4q_3q; double rho; long run; double sphericity; double std_bdisc; double std_bdisc_btag; double std_dr_btag; int triggerBitmask; int triggerDecision; int ttCls; double tth_mva; double xsec; void loadTree(TTree* tree) { tree->SetBranchAddress("ncommon_mem", &(this->ncommon_mem)); tree->SetBranchAddress("common_mem_p_bkg", this->common_mem_p_bkg); tree->SetBranchAddress("common_mem_p", this->common_mem_p); tree->SetBranchAddress("common_mem_blr_4b", this->common_mem_blr_4b); tree->SetBranchAddress("common_mem_blr_2b", this->common_mem_blr_2b); tree->SetBranchAddress("common_mem_p_sig", this->common_mem_p_sig); tree->SetBranchAddress("nfatjets", &(this->nfatjets)); tree->SetBranchAddress("fatjets_phi", this->fatjets_phi); tree->SetBranchAddress("fatjets_pt", this->fatjets_pt); tree->SetBranchAddress("fatjets_tau1", this->fatjets_tau1); tree->SetBranchAddress("fatjets_tau2", this->fatjets_tau2); tree->SetBranchAddress("fatjets_tau3", this->fatjets_tau3); tree->SetBranchAddress("fatjets_eta", this->fatjets_eta); tree->SetBranchAddress("fatjets_mass", this->fatjets_mass); tree->SetBranchAddress("fatjets_bbtag", this->fatjets_bbtag); tree->SetBranchAddress("nfw_aj", &(this->nfw_aj)); tree->SetBranchAddress("fw_aj_fw_h_alljets_nominal", this->fw_aj_fw_h_alljets_nominal); tree->SetBranchAddress("nfw_bj", &(this->nfw_bj)); tree->SetBranchAddress("fw_bj_fw_h_btagjets_nominal", this->fw_bj_fw_h_btagjets_nominal); tree->SetBranchAddress("nfw_uj", &(this->nfw_uj)); tree->SetBranchAddress("fw_uj_fw_h_untagjets_nominal", this->fw_uj_fw_h_untagjets_nominal); tree->SetBranchAddress("ngenHiggs", &(this->ngenHiggs)); tree->SetBranchAddress("genHiggs_phi", this->genHiggs_phi); tree->SetBranchAddress("genHiggs_eta", this->genHiggs_eta); tree->SetBranchAddress("genHiggs_mass", this->genHiggs_mass); tree->SetBranchAddress("genHiggs_id", this->genHiggs_id); tree->SetBranchAddress("genHiggs_pt", this->genHiggs_pt); tree->SetBranchAddress("ngenTopHad", &(this->ngenTopHad)); tree->SetBranchAddress("genTopHad_phi", this->genTopHad_phi); tree->SetBranchAddress("genTopHad_eta", this->genTopHad_eta); tree->SetBranchAddress("genTopHad_mass", this->genTopHad_mass); tree->SetBranchAddress("genTopHad_pt", this->genTopHad_pt); tree->SetBranchAddress("genTopHad_decayMode", this->genTopHad_decayMode); tree->SetBranchAddress("ngenTopLep", &(this->ngenTopLep)); tree->SetBranchAddress("genTopLep_phi", this->genTopLep_phi); tree->SetBranchAddress("genTopLep_eta", this->genTopLep_eta); tree->SetBranchAddress("genTopLep_mass", this->genTopLep_mass); tree->SetBranchAddress("genTopLep_pt", this->genTopLep_pt); tree->SetBranchAddress("genTopLep_decayMode", this->genTopLep_decayMode); tree->SetBranchAddress("nhiggsCandidate", &(this->nhiggsCandidate)); tree->SetBranchAddress("higgsCandidate_sj1eta_softdropfilt", this->higgsCandidate_sj1eta_softdropfilt); tree->SetBranchAddress("higgsCandidate_mass_softdrop", this->higgsCandidate_mass_softdrop); tree->SetBranchAddress("higgsCandidate_sj2mass_pruned", this->higgsCandidate_sj2mass_pruned); tree->SetBranchAddress("higgsCandidate_sj2pt_pruned", this->higgsCandidate_sj2pt_pruned); tree->SetBranchAddress("higgsCandidate_sj2eta_softdropfilt", this->higgsCandidate_sj2eta_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj2pt_softdropfilt", this->higgsCandidate_sj2pt_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj2eta_softdropz2b1filt", this->higgsCandidate_sj2eta_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj2mass_softdropfilt", this->higgsCandidate_sj2mass_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj2mass_softdropz2b1filt", this->higgsCandidate_sj2mass_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj2eta_softdrop", this->higgsCandidate_sj2eta_softdrop); tree->SetBranchAddress("higgsCandidate_sj2phi_pruned", this->higgsCandidate_sj2phi_pruned); tree->SetBranchAddress("higgsCandidate_mass_softdropfilt", this->higgsCandidate_mass_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj1phi_softdrop", this->higgsCandidate_sj1phi_softdrop); tree->SetBranchAddress("higgsCandidate_sj1eta_subjetfiltered", this->higgsCandidate_sj1eta_subjetfiltered); tree->SetBranchAddress("higgsCandidate_dr_top", this->higgsCandidate_dr_top); tree->SetBranchAddress("higgsCandidate_sj1mass_softdropz2b1filt", this->higgsCandidate_sj1mass_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_n_subjettiness", this->higgsCandidate_n_subjettiness); tree->SetBranchAddress("higgsCandidate_sj2eta_softdropz2b1", this->higgsCandidate_sj2eta_softdropz2b1); tree->SetBranchAddress("higgsCandidate_dr_genHiggs", this->higgsCandidate_dr_genHiggs); tree->SetBranchAddress("higgsCandidate_sj3pt_subjetfiltered", this->higgsCandidate_sj3pt_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2btag_softdropfilt", this->higgsCandidate_sj2btag_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj2eta_pruned", this->higgsCandidate_sj2eta_pruned); tree->SetBranchAddress("higgsCandidate_sj2pt_subjetfiltered", this->higgsCandidate_sj2pt_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2mass_subjetfiltered", this->higgsCandidate_sj2mass_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj12masspt_subjetfiltered", this->higgsCandidate_sj12masspt_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj1pt_subjetfiltered", this->higgsCandidate_sj1pt_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2btag_softdropz2b1filt", this->higgsCandidate_sj2btag_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj1pt_softdropfilt", this->higgsCandidate_sj1pt_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj1phi_softdropfilt", this->higgsCandidate_sj1phi_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj1mass_softdropz2b1", this->higgsCandidate_sj1mass_softdropz2b1); tree->SetBranchAddress("higgsCandidate_nallsubjets_softdropz2b1filt", this->higgsCandidate_nallsubjets_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_dr_genTop", this->higgsCandidate_dr_genTop); tree->SetBranchAddress("higgsCandidate_nallsubjets_pruned", this->higgsCandidate_nallsubjets_pruned); tree->SetBranchAddress("higgsCandidate_sj1pt_softdropz2b1filt", this->higgsCandidate_sj1pt_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj3btag_subjetfiltered", this->higgsCandidate_sj3btag_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2btag_subjetfiltered", this->higgsCandidate_sj2btag_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj1btag_softdrop", this->higgsCandidate_sj1btag_softdrop); tree->SetBranchAddress("higgsCandidate_eta", this->higgsCandidate_eta); tree->SetBranchAddress("higgsCandidate_sj1btag_softdropfilt", this->higgsCandidate_sj1btag_softdropfilt); tree->SetBranchAddress("higgsCandidate_nallsubjets_softdropfilt", this->higgsCandidate_nallsubjets_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj12massb_subjetfiltered", this->higgsCandidate_sj12massb_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj1phi_pruned", this->higgsCandidate_sj1phi_pruned); tree->SetBranchAddress("higgsCandidate_sj2pt_softdrop", this->higgsCandidate_sj2pt_softdrop); tree->SetBranchAddress("higgsCandidate_sj3phi_subjetfiltered", this->higgsCandidate_sj3phi_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2mass_softdrop", this->higgsCandidate_sj2mass_softdrop); tree->SetBranchAddress("higgsCandidate_sj1pt_pruned", this->higgsCandidate_sj1pt_pruned); tree->SetBranchAddress("higgsCandidate_mass_softdropz2b1filt", this->higgsCandidate_mass_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj1eta_pruned", this->higgsCandidate_sj1eta_pruned); tree->SetBranchAddress("higgsCandidate_sj1phi_subjetfiltered", this->higgsCandidate_sj1phi_subjetfiltered); tree->SetBranchAddress("higgsCandidate_mass_pruned", this->higgsCandidate_mass_pruned); tree->SetBranchAddress("higgsCandidate_pt", this->higgsCandidate_pt); tree->SetBranchAddress("higgsCandidate_sj1eta_softdropz2b1filt", this->higgsCandidate_sj1eta_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_nallsubjets_softdropz2b1", this->higgsCandidate_nallsubjets_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj1pt_softdrop", this->higgsCandidate_sj1pt_softdrop); tree->SetBranchAddress("higgsCandidate_tau2", this->higgsCandidate_tau2); tree->SetBranchAddress("higgsCandidate_tau3", this->higgsCandidate_tau3); tree->SetBranchAddress("higgsCandidate_sj3eta_subjetfiltered", this->higgsCandidate_sj3eta_subjetfiltered); tree->SetBranchAddress("higgsCandidate_tau1", this->higgsCandidate_tau1); tree->SetBranchAddress("higgsCandidate_nallsubjets_softdrop", this->higgsCandidate_nallsubjets_softdrop); tree->SetBranchAddress("higgsCandidate_sj2btag_pruned", this->higgsCandidate_sj2btag_pruned); tree->SetBranchAddress("higgsCandidate_sj1eta_softdrop", this->higgsCandidate_sj1eta_softdrop); tree->SetBranchAddress("higgsCandidate_sj1btag_softdropz2b1filt", this->higgsCandidate_sj1btag_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj2mass_softdropz2b1", this->higgsCandidate_sj2mass_softdropz2b1); tree->SetBranchAddress("higgsCandidate_nallsubjets_subjetfiltered", this->higgsCandidate_nallsubjets_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2pt_softdropz2b1", this->higgsCandidate_sj2pt_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj2pt_softdropz2b1filt", this->higgsCandidate_sj2pt_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj2phi_softdropz2b1", this->higgsCandidate_sj2phi_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj2phi_softdropz2b1filt", this->higgsCandidate_sj2phi_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_sj1mass_pruned", this->higgsCandidate_sj1mass_pruned); tree->SetBranchAddress("higgsCandidate_sj1pt_softdropz2b1", this->higgsCandidate_sj1pt_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj1mass_softdrop", this->higgsCandidate_sj1mass_softdrop); tree->SetBranchAddress("higgsCandidate_sj1btag_softdropz2b1", this->higgsCandidate_sj1btag_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj1btag_subjetfiltered", this->higgsCandidate_sj1btag_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj1eta_softdropz2b1", this->higgsCandidate_sj1eta_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj2eta_subjetfiltered", this->higgsCandidate_sj2eta_subjetfiltered); tree->SetBranchAddress("higgsCandidate_secondbtag_subjetfiltered", this->higgsCandidate_secondbtag_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj2btag_softdrop", this->higgsCandidate_sj2btag_softdrop); tree->SetBranchAddress("higgsCandidate_sj2phi_softdropfilt", this->higgsCandidate_sj2phi_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj3mass_subjetfiltered", this->higgsCandidate_sj3mass_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj1mass_subjetfiltered", this->higgsCandidate_sj1mass_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj1btag_pruned", this->higgsCandidate_sj1btag_pruned); tree->SetBranchAddress("higgsCandidate_sj2phi_subjetfiltered", this->higgsCandidate_sj2phi_subjetfiltered); tree->SetBranchAddress("higgsCandidate_sj123masspt_subjetfiltered", this->higgsCandidate_sj123masspt_subjetfiltered); tree->SetBranchAddress("higgsCandidate_phi", this->higgsCandidate_phi); tree->SetBranchAddress("higgsCandidate_sj1mass_softdropfilt", this->higgsCandidate_sj1mass_softdropfilt); tree->SetBranchAddress("higgsCandidate_sj2phi_softdrop", this->higgsCandidate_sj2phi_softdrop); tree->SetBranchAddress("higgsCandidate_sj1phi_softdropz2b1", this->higgsCandidate_sj1phi_softdropz2b1); tree->SetBranchAddress("higgsCandidate_sj1phi_softdropz2b1filt", this->higgsCandidate_sj1phi_softdropz2b1filt); tree->SetBranchAddress("higgsCandidate_mass", this->higgsCandidate_mass); tree->SetBranchAddress("higgsCandidate_sj2btag_softdropz2b1", this->higgsCandidate_sj2btag_softdropz2b1); tree->SetBranchAddress("higgsCandidate_bbtag", this->higgsCandidate_bbtag); tree->SetBranchAddress("higgsCandidate_mass_softdropz2b1", this->higgsCandidate_mass_softdropz2b1); tree->SetBranchAddress("njets", &(this->njets)); tree->SetBranchAddress("jets_mcPt", this->jets_mcPt); tree->SetBranchAddress("jets_mcEta", this->jets_mcEta); tree->SetBranchAddress("jets_btagCMVA", this->jets_btagCMVA); tree->SetBranchAddress("jets_id", this->jets_id); tree->SetBranchAddress("jets_btagFlag", this->jets_btagFlag); tree->SetBranchAddress("jets_pt", this->jets_pt); tree->SetBranchAddress("jets_corr_JERDown", this->jets_corr_JERDown); tree->SetBranchAddress("jets_qgl", this->jets_qgl); tree->SetBranchAddress("jets_mcPhi", this->jets_mcPhi); tree->SetBranchAddress("jets_mcNumCHadrons", this->jets_mcNumCHadrons); tree->SetBranchAddress("jets_matchFlag", this->jets_matchFlag); tree->SetBranchAddress("jets_phi", this->jets_phi); tree->SetBranchAddress("jets_matchBfromHadT", this->jets_matchBfromHadT); tree->SetBranchAddress("jets_hadronFlavour", this->jets_hadronFlavour); tree->SetBranchAddress("jets_corr_JESUp", this->jets_corr_JESUp); tree->SetBranchAddress("jets_corr_JERUp", this->jets_corr_JERUp); tree->SetBranchAddress("jets_corr", this->jets_corr); tree->SetBranchAddress("jets_corr_JER", this->jets_corr_JER); tree->SetBranchAddress("jets_corr_JESDown", this->jets_corr_JESDown); tree->SetBranchAddress("jets_mcM", this->jets_mcM); tree->SetBranchAddress("jets_btagCSV", this->jets_btagCSV); tree->SetBranchAddress("jets_mcMatchId", this->jets_mcMatchId); tree->SetBranchAddress("jets_btagCMVA_log", this->jets_btagCMVA_log); tree->SetBranchAddress("jets_mcNumBHadrons", this->jets_mcNumBHadrons); tree->SetBranchAddress("jets_eta", this->jets_eta); tree->SetBranchAddress("jets_mass", this->jets_mass); tree->SetBranchAddress("jets_mcFlavour", this->jets_mcFlavour); tree->SetBranchAddress("nleps", &(this->nleps)); tree->SetBranchAddress("leps_phi", this->leps_phi); tree->SetBranchAddress("leps_pt", this->leps_pt); tree->SetBranchAddress("leps_pdgId", this->leps_pdgId); tree->SetBranchAddress("leps_relIso04", this->leps_relIso04); tree->SetBranchAddress("leps_eta", this->leps_eta); tree->SetBranchAddress("leps_mass", this->leps_mass); tree->SetBranchAddress("leps_relIso03", this->leps_relIso03); tree->SetBranchAddress("leps_mvaId", this->leps_mvaId); tree->SetBranchAddress("nloose_jets", &(this->nloose_jets)); tree->SetBranchAddress("loose_jets_mcPt", this->loose_jets_mcPt); tree->SetBranchAddress("loose_jets_mcEta", this->loose_jets_mcEta); tree->SetBranchAddress("loose_jets_btagCMVA", this->loose_jets_btagCMVA); tree->SetBranchAddress("loose_jets_id", this->loose_jets_id); tree->SetBranchAddress("loose_jets_btagFlag", this->loose_jets_btagFlag); tree->SetBranchAddress("loose_jets_pt", this->loose_jets_pt); tree->SetBranchAddress("loose_jets_corr_JERDown", this->loose_jets_corr_JERDown); tree->SetBranchAddress("loose_jets_qgl", this->loose_jets_qgl); tree->SetBranchAddress("loose_jets_mcPhi", this->loose_jets_mcPhi); tree->SetBranchAddress("loose_jets_mcNumCHadrons", this->loose_jets_mcNumCHadrons); tree->SetBranchAddress("loose_jets_matchFlag", this->loose_jets_matchFlag); tree->SetBranchAddress("loose_jets_phi", this->loose_jets_phi); tree->SetBranchAddress("loose_jets_matchBfromHadT", this->loose_jets_matchBfromHadT); tree->SetBranchAddress("loose_jets_hadronFlavour", this->loose_jets_hadronFlavour); tree->SetBranchAddress("loose_jets_corr_JESUp", this->loose_jets_corr_JESUp); tree->SetBranchAddress("loose_jets_corr_JERUp", this->loose_jets_corr_JERUp); tree->SetBranchAddress("loose_jets_corr", this->loose_jets_corr); tree->SetBranchAddress("loose_jets_corr_JER", this->loose_jets_corr_JER); tree->SetBranchAddress("loose_jets_corr_JESDown", this->loose_jets_corr_JESDown); tree->SetBranchAddress("loose_jets_mcM", this->loose_jets_mcM); tree->SetBranchAddress("loose_jets_btagCSV", this->loose_jets_btagCSV); tree->SetBranchAddress("loose_jets_mcMatchId", this->loose_jets_mcMatchId); tree->SetBranchAddress("loose_jets_btagCMVA_log", this->loose_jets_btagCMVA_log); tree->SetBranchAddress("loose_jets_mcNumBHadrons", this->loose_jets_mcNumBHadrons); tree->SetBranchAddress("loose_jets_eta", this->loose_jets_eta); tree->SetBranchAddress("loose_jets_mass", this->loose_jets_mass); tree->SetBranchAddress("loose_jets_mcFlavour", this->loose_jets_mcFlavour); tree->SetBranchAddress("nmem_ttbb_DL_0w2h2t_perm", &(this->nmem_ttbb_DL_0w2h2t_perm)); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_p_me_mean", this->mem_ttbb_DL_0w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_p_tf_std", this->mem_ttbb_DL_0w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_idx", this->mem_ttbb_DL_0w2h2t_perm_idx); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_p_std", this->mem_ttbb_DL_0w2h2t_perm_p_std); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_p_mean", this->mem_ttbb_DL_0w2h2t_perm_p_mean); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_5", this->mem_ttbb_DL_0w2h2t_perm_perm_5); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_4", this->mem_ttbb_DL_0w2h2t_perm_perm_4); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_7", this->mem_ttbb_DL_0w2h2t_perm_perm_7); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_6", this->mem_ttbb_DL_0w2h2t_perm_perm_6); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_1", this->mem_ttbb_DL_0w2h2t_perm_perm_1); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_0", this->mem_ttbb_DL_0w2h2t_perm_perm_0); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_3", this->mem_ttbb_DL_0w2h2t_perm_perm_3); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_2", this->mem_ttbb_DL_0w2h2t_perm_perm_2); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_p_tf_mean", this->mem_ttbb_DL_0w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_p_me_std", this->mem_ttbb_DL_0w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_9", this->mem_ttbb_DL_0w2h2t_perm_perm_9); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_perm_perm_8", this->mem_ttbb_DL_0w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_ttbb_SL_0w2h2t_perm", &(this->nmem_ttbb_SL_0w2h2t_perm)); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_p_me_mean", this->mem_ttbb_SL_0w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_p_tf_std", this->mem_ttbb_SL_0w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_idx", this->mem_ttbb_SL_0w2h2t_perm_idx); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_p_std", this->mem_ttbb_SL_0w2h2t_perm_p_std); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_p_mean", this->mem_ttbb_SL_0w2h2t_perm_p_mean); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_5", this->mem_ttbb_SL_0w2h2t_perm_perm_5); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_4", this->mem_ttbb_SL_0w2h2t_perm_perm_4); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_7", this->mem_ttbb_SL_0w2h2t_perm_perm_7); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_6", this->mem_ttbb_SL_0w2h2t_perm_perm_6); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_1", this->mem_ttbb_SL_0w2h2t_perm_perm_1); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_0", this->mem_ttbb_SL_0w2h2t_perm_perm_0); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_3", this->mem_ttbb_SL_0w2h2t_perm_perm_3); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_2", this->mem_ttbb_SL_0w2h2t_perm_perm_2); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_p_tf_mean", this->mem_ttbb_SL_0w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_p_me_std", this->mem_ttbb_SL_0w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_9", this->mem_ttbb_SL_0w2h2t_perm_perm_9); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_perm_perm_8", this->mem_ttbb_SL_0w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_ttbb_SL_1w2h2t_perm", &(this->nmem_ttbb_SL_1w2h2t_perm)); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_p_me_mean", this->mem_ttbb_SL_1w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_p_tf_std", this->mem_ttbb_SL_1w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_idx", this->mem_ttbb_SL_1w2h2t_perm_idx); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_p_std", this->mem_ttbb_SL_1w2h2t_perm_p_std); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_p_mean", this->mem_ttbb_SL_1w2h2t_perm_p_mean); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_5", this->mem_ttbb_SL_1w2h2t_perm_perm_5); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_4", this->mem_ttbb_SL_1w2h2t_perm_perm_4); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_7", this->mem_ttbb_SL_1w2h2t_perm_perm_7); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_6", this->mem_ttbb_SL_1w2h2t_perm_perm_6); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_1", this->mem_ttbb_SL_1w2h2t_perm_perm_1); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_0", this->mem_ttbb_SL_1w2h2t_perm_perm_0); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_3", this->mem_ttbb_SL_1w2h2t_perm_perm_3); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_2", this->mem_ttbb_SL_1w2h2t_perm_perm_2); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_p_tf_mean", this->mem_ttbb_SL_1w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_p_me_std", this->mem_ttbb_SL_1w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_9", this->mem_ttbb_SL_1w2h2t_perm_perm_9); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_perm_perm_8", this->mem_ttbb_SL_1w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_ttbb_SL_2w2h2t_perm", &(this->nmem_ttbb_SL_2w2h2t_perm)); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_p_me_mean", this->mem_ttbb_SL_2w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_p_tf_std", this->mem_ttbb_SL_2w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_idx", this->mem_ttbb_SL_2w2h2t_perm_idx); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_p_std", this->mem_ttbb_SL_2w2h2t_perm_p_std); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_p_mean", this->mem_ttbb_SL_2w2h2t_perm_p_mean); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_5", this->mem_ttbb_SL_2w2h2t_perm_perm_5); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_4", this->mem_ttbb_SL_2w2h2t_perm_perm_4); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_7", this->mem_ttbb_SL_2w2h2t_perm_perm_7); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_6", this->mem_ttbb_SL_2w2h2t_perm_perm_6); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_1", this->mem_ttbb_SL_2w2h2t_perm_perm_1); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_0", this->mem_ttbb_SL_2w2h2t_perm_perm_0); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_3", this->mem_ttbb_SL_2w2h2t_perm_perm_3); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_2", this->mem_ttbb_SL_2w2h2t_perm_perm_2); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_p_tf_mean", this->mem_ttbb_SL_2w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_p_me_std", this->mem_ttbb_SL_2w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_9", this->mem_ttbb_SL_2w2h2t_perm_perm_9); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_perm_perm_8", this->mem_ttbb_SL_2w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_tth_DL_0w2h2t_perm", &(this->nmem_tth_DL_0w2h2t_perm)); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_p_me_mean", this->mem_tth_DL_0w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_p_tf_std", this->mem_tth_DL_0w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_idx", this->mem_tth_DL_0w2h2t_perm_idx); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_p_std", this->mem_tth_DL_0w2h2t_perm_p_std); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_p_mean", this->mem_tth_DL_0w2h2t_perm_p_mean); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_5", this->mem_tth_DL_0w2h2t_perm_perm_5); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_4", this->mem_tth_DL_0w2h2t_perm_perm_4); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_7", this->mem_tth_DL_0w2h2t_perm_perm_7); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_6", this->mem_tth_DL_0w2h2t_perm_perm_6); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_1", this->mem_tth_DL_0w2h2t_perm_perm_1); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_0", this->mem_tth_DL_0w2h2t_perm_perm_0); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_3", this->mem_tth_DL_0w2h2t_perm_perm_3); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_2", this->mem_tth_DL_0w2h2t_perm_perm_2); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_p_tf_mean", this->mem_tth_DL_0w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_p_me_std", this->mem_tth_DL_0w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_9", this->mem_tth_DL_0w2h2t_perm_perm_9); tree->SetBranchAddress("mem_tth_DL_0w2h2t_perm_perm_8", this->mem_tth_DL_0w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_tth_SL_0w2h2t_perm", &(this->nmem_tth_SL_0w2h2t_perm)); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_p_me_mean", this->mem_tth_SL_0w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_p_tf_std", this->mem_tth_SL_0w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_idx", this->mem_tth_SL_0w2h2t_perm_idx); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_p_std", this->mem_tth_SL_0w2h2t_perm_p_std); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_p_mean", this->mem_tth_SL_0w2h2t_perm_p_mean); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_5", this->mem_tth_SL_0w2h2t_perm_perm_5); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_4", this->mem_tth_SL_0w2h2t_perm_perm_4); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_7", this->mem_tth_SL_0w2h2t_perm_perm_7); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_6", this->mem_tth_SL_0w2h2t_perm_perm_6); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_1", this->mem_tth_SL_0w2h2t_perm_perm_1); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_0", this->mem_tth_SL_0w2h2t_perm_perm_0); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_3", this->mem_tth_SL_0w2h2t_perm_perm_3); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_2", this->mem_tth_SL_0w2h2t_perm_perm_2); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_p_tf_mean", this->mem_tth_SL_0w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_p_me_std", this->mem_tth_SL_0w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_9", this->mem_tth_SL_0w2h2t_perm_perm_9); tree->SetBranchAddress("mem_tth_SL_0w2h2t_perm_perm_8", this->mem_tth_SL_0w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_tth_SL_1w2h2t_perm", &(this->nmem_tth_SL_1w2h2t_perm)); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_p_me_mean", this->mem_tth_SL_1w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_p_tf_std", this->mem_tth_SL_1w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_idx", this->mem_tth_SL_1w2h2t_perm_idx); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_p_std", this->mem_tth_SL_1w2h2t_perm_p_std); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_p_mean", this->mem_tth_SL_1w2h2t_perm_p_mean); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_5", this->mem_tth_SL_1w2h2t_perm_perm_5); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_4", this->mem_tth_SL_1w2h2t_perm_perm_4); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_7", this->mem_tth_SL_1w2h2t_perm_perm_7); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_6", this->mem_tth_SL_1w2h2t_perm_perm_6); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_1", this->mem_tth_SL_1w2h2t_perm_perm_1); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_0", this->mem_tth_SL_1w2h2t_perm_perm_0); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_3", this->mem_tth_SL_1w2h2t_perm_perm_3); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_2", this->mem_tth_SL_1w2h2t_perm_perm_2); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_p_tf_mean", this->mem_tth_SL_1w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_p_me_std", this->mem_tth_SL_1w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_9", this->mem_tth_SL_1w2h2t_perm_perm_9); tree->SetBranchAddress("mem_tth_SL_1w2h2t_perm_perm_8", this->mem_tth_SL_1w2h2t_perm_perm_8); tree->SetBranchAddress("nmem_tth_SL_2w2h2t_perm", &(this->nmem_tth_SL_2w2h2t_perm)); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_p_me_mean", this->mem_tth_SL_2w2h2t_perm_p_me_mean); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_p_tf_std", this->mem_tth_SL_2w2h2t_perm_p_tf_std); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_idx", this->mem_tth_SL_2w2h2t_perm_idx); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_p_std", this->mem_tth_SL_2w2h2t_perm_p_std); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_p_mean", this->mem_tth_SL_2w2h2t_perm_p_mean); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_5", this->mem_tth_SL_2w2h2t_perm_perm_5); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_4", this->mem_tth_SL_2w2h2t_perm_perm_4); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_7", this->mem_tth_SL_2w2h2t_perm_perm_7); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_6", this->mem_tth_SL_2w2h2t_perm_perm_6); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_1", this->mem_tth_SL_2w2h2t_perm_perm_1); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_0", this->mem_tth_SL_2w2h2t_perm_perm_0); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_3", this->mem_tth_SL_2w2h2t_perm_perm_3); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_2", this->mem_tth_SL_2w2h2t_perm_perm_2); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_p_tf_mean", this->mem_tth_SL_2w2h2t_perm_p_tf_mean); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_p_me_std", this->mem_tth_SL_2w2h2t_perm_p_me_std); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_9", this->mem_tth_SL_2w2h2t_perm_perm_9); tree->SetBranchAddress("mem_tth_SL_2w2h2t_perm_perm_8", this->mem_tth_SL_2w2h2t_perm_perm_8); tree->SetBranchAddress("nothertopCandidate", &(this->nothertopCandidate)); tree->SetBranchAddress("othertopCandidate_tau1", this->othertopCandidate_tau1); tree->SetBranchAddress("othertopCandidate_etacal", this->othertopCandidate_etacal); tree->SetBranchAddress("othertopCandidate_sjW2btag", this->othertopCandidate_sjW2btag); tree->SetBranchAddress("othertopCandidate_n_subjettiness_groomed", this->othertopCandidate_n_subjettiness_groomed); tree->SetBranchAddress("othertopCandidate_sjW2pt", this->othertopCandidate_sjW2pt); tree->SetBranchAddress("othertopCandidate_sjW1ptcal", this->othertopCandidate_sjW1ptcal); tree->SetBranchAddress("othertopCandidate_sjW1btag", this->othertopCandidate_sjW1btag); tree->SetBranchAddress("othertopCandidate_sjW1mass", this->othertopCandidate_sjW1mass); tree->SetBranchAddress("othertopCandidate_sjNonWmass", this->othertopCandidate_sjNonWmass); tree->SetBranchAddress("othertopCandidate_sjNonWptcal", this->othertopCandidate_sjNonWptcal); tree->SetBranchAddress("othertopCandidate_sjNonWeta", this->othertopCandidate_sjNonWeta); tree->SetBranchAddress("othertopCandidate_pt", this->othertopCandidate_pt); tree->SetBranchAddress("othertopCandidate_sjW2masscal", this->othertopCandidate_sjW2masscal); tree->SetBranchAddress("othertopCandidate_ptForRoptCalc", this->othertopCandidate_ptForRoptCalc); tree->SetBranchAddress("othertopCandidate_tau2", this->othertopCandidate_tau2); tree->SetBranchAddress("othertopCandidate_phi", this->othertopCandidate_phi); tree->SetBranchAddress("othertopCandidate_tau3", this->othertopCandidate_tau3); tree->SetBranchAddress("othertopCandidate_sjNonWpt", this->othertopCandidate_sjNonWpt); tree->SetBranchAddress("othertopCandidate_sjNonWmasscal", this->othertopCandidate_sjNonWmasscal); tree->SetBranchAddress("othertopCandidate_sjW1masscal", this->othertopCandidate_sjW1masscal); tree->SetBranchAddress("othertopCandidate_sjW2mass", this->othertopCandidate_sjW2mass); tree->SetBranchAddress("othertopCandidate_mass", this->othertopCandidate_mass); tree->SetBranchAddress("othertopCandidate_sjNonWbtag", this->othertopCandidate_sjNonWbtag); tree->SetBranchAddress("othertopCandidate_Ropt", this->othertopCandidate_Ropt); tree->SetBranchAddress("othertopCandidate_RoptCalc", this->othertopCandidate_RoptCalc); tree->SetBranchAddress("othertopCandidate_masscal", this->othertopCandidate_masscal); tree->SetBranchAddress("othertopCandidate_ptcal", this->othertopCandidate_ptcal); tree->SetBranchAddress("othertopCandidate_sjW1phi", this->othertopCandidate_sjW1phi); tree->SetBranchAddress("othertopCandidate_sjW1pt", this->othertopCandidate_sjW1pt); tree->SetBranchAddress("othertopCandidate_sjNonWphi", this->othertopCandidate_sjNonWphi); tree->SetBranchAddress("othertopCandidate_delRopt", this->othertopCandidate_delRopt); tree->SetBranchAddress("othertopCandidate_sjW1eta", this->othertopCandidate_sjW1eta); tree->SetBranchAddress("othertopCandidate_fRec", this->othertopCandidate_fRec); tree->SetBranchAddress("othertopCandidate_phical", this->othertopCandidate_phical); tree->SetBranchAddress("othertopCandidate_sjW2phi", this->othertopCandidate_sjW2phi); tree->SetBranchAddress("othertopCandidate_eta", this->othertopCandidate_eta); tree->SetBranchAddress("othertopCandidate_n_subjettiness", this->othertopCandidate_n_subjettiness); tree->SetBranchAddress("othertopCandidate_sjW2ptcal", this->othertopCandidate_sjW2ptcal); tree->SetBranchAddress("othertopCandidate_bbtag", this->othertopCandidate_bbtag); tree->SetBranchAddress("othertopCandidate_sjW2eta", this->othertopCandidate_sjW2eta); tree->SetBranchAddress("othertopCandidate_genTopHad_dr", this->othertopCandidate_genTopHad_dr); tree->SetBranchAddress("ntopCandidate", &(this->ntopCandidate)); tree->SetBranchAddress("topCandidate_tau1", this->topCandidate_tau1); tree->SetBranchAddress("topCandidate_etacal", this->topCandidate_etacal); tree->SetBranchAddress("topCandidate_sjW2btag", this->topCandidate_sjW2btag); tree->SetBranchAddress("topCandidate_n_subjettiness_groomed", this->topCandidate_n_subjettiness_groomed); tree->SetBranchAddress("topCandidate_sjW2pt", this->topCandidate_sjW2pt); tree->SetBranchAddress("topCandidate_sjW1ptcal", this->topCandidate_sjW1ptcal); tree->SetBranchAddress("topCandidate_sjW1btag", this->topCandidate_sjW1btag); tree->SetBranchAddress("topCandidate_sjW1mass", this->topCandidate_sjW1mass); tree->SetBranchAddress("topCandidate_sjNonWmass", this->topCandidate_sjNonWmass); tree->SetBranchAddress("topCandidate_sjNonWptcal", this->topCandidate_sjNonWptcal); tree->SetBranchAddress("topCandidate_sjNonWeta", this->topCandidate_sjNonWeta); tree->SetBranchAddress("topCandidate_pt", this->topCandidate_pt); tree->SetBranchAddress("topCandidate_sjW2masscal", this->topCandidate_sjW2masscal); tree->SetBranchAddress("topCandidate_ptForRoptCalc", this->topCandidate_ptForRoptCalc); tree->SetBranchAddress("topCandidate_tau2", this->topCandidate_tau2); tree->SetBranchAddress("topCandidate_phi", this->topCandidate_phi); tree->SetBranchAddress("topCandidate_tau3", this->topCandidate_tau3); tree->SetBranchAddress("topCandidate_sjNonWpt", this->topCandidate_sjNonWpt); tree->SetBranchAddress("topCandidate_sjNonWmasscal", this->topCandidate_sjNonWmasscal); tree->SetBranchAddress("topCandidate_sjW1masscal", this->topCandidate_sjW1masscal); tree->SetBranchAddress("topCandidate_sjW2mass", this->topCandidate_sjW2mass); tree->SetBranchAddress("topCandidate_mass", this->topCandidate_mass); tree->SetBranchAddress("topCandidate_sjNonWbtag", this->topCandidate_sjNonWbtag); tree->SetBranchAddress("topCandidate_Ropt", this->topCandidate_Ropt); tree->SetBranchAddress("topCandidate_RoptCalc", this->topCandidate_RoptCalc); tree->SetBranchAddress("topCandidate_masscal", this->topCandidate_masscal); tree->SetBranchAddress("topCandidate_ptcal", this->topCandidate_ptcal); tree->SetBranchAddress("topCandidate_sjW1phi", this->topCandidate_sjW1phi); tree->SetBranchAddress("topCandidate_sjW1pt", this->topCandidate_sjW1pt); tree->SetBranchAddress("topCandidate_sjNonWphi", this->topCandidate_sjNonWphi); tree->SetBranchAddress("topCandidate_delRopt", this->topCandidate_delRopt); tree->SetBranchAddress("topCandidate_sjW1eta", this->topCandidate_sjW1eta); tree->SetBranchAddress("topCandidate_fRec", this->topCandidate_fRec); tree->SetBranchAddress("topCandidate_phical", this->topCandidate_phical); tree->SetBranchAddress("topCandidate_sjW2phi", this->topCandidate_sjW2phi); tree->SetBranchAddress("topCandidate_eta", this->topCandidate_eta); tree->SetBranchAddress("topCandidate_n_subjettiness", this->topCandidate_n_subjettiness); tree->SetBranchAddress("topCandidate_sjW2ptcal", this->topCandidate_sjW2ptcal); tree->SetBranchAddress("topCandidate_bbtag", this->topCandidate_bbtag); tree->SetBranchAddress("topCandidate_sjW2eta", this->topCandidate_sjW2eta); tree->SetBranchAddress("topCandidate_genTopHad_dr", this->topCandidate_genTopHad_dr); tree->SetBranchAddress("ntopCandidatesSync", &(this->ntopCandidatesSync)); tree->SetBranchAddress("topCandidatesSync_tau1", this->topCandidatesSync_tau1); tree->SetBranchAddress("topCandidatesSync_etacal", this->topCandidatesSync_etacal); tree->SetBranchAddress("topCandidatesSync_sjW2btag", this->topCandidatesSync_sjW2btag); tree->SetBranchAddress("topCandidatesSync_n_subjettiness_groomed", this->topCandidatesSync_n_subjettiness_groomed); tree->SetBranchAddress("topCandidatesSync_sjW2pt", this->topCandidatesSync_sjW2pt); tree->SetBranchAddress("topCandidatesSync_sjW1ptcal", this->topCandidatesSync_sjW1ptcal); tree->SetBranchAddress("topCandidatesSync_sjW1btag", this->topCandidatesSync_sjW1btag); tree->SetBranchAddress("topCandidatesSync_sjW1mass", this->topCandidatesSync_sjW1mass); tree->SetBranchAddress("topCandidatesSync_sjNonWmass", this->topCandidatesSync_sjNonWmass); tree->SetBranchAddress("topCandidatesSync_sjNonWptcal", this->topCandidatesSync_sjNonWptcal); tree->SetBranchAddress("topCandidatesSync_sjNonWeta", this->topCandidatesSync_sjNonWeta); tree->SetBranchAddress("topCandidatesSync_pt", this->topCandidatesSync_pt); tree->SetBranchAddress("topCandidatesSync_sjW2masscal", this->topCandidatesSync_sjW2masscal); tree->SetBranchAddress("topCandidatesSync_ptForRoptCalc", this->topCandidatesSync_ptForRoptCalc); tree->SetBranchAddress("topCandidatesSync_tau2", this->topCandidatesSync_tau2); tree->SetBranchAddress("topCandidatesSync_phi", this->topCandidatesSync_phi); tree->SetBranchAddress("topCandidatesSync_tau3", this->topCandidatesSync_tau3); tree->SetBranchAddress("topCandidatesSync_sjNonWpt", this->topCandidatesSync_sjNonWpt); tree->SetBranchAddress("topCandidatesSync_sjNonWmasscal", this->topCandidatesSync_sjNonWmasscal); tree->SetBranchAddress("topCandidatesSync_sjW1masscal", this->topCandidatesSync_sjW1masscal); tree->SetBranchAddress("topCandidatesSync_sjW2mass", this->topCandidatesSync_sjW2mass); tree->SetBranchAddress("topCandidatesSync_mass", this->topCandidatesSync_mass); tree->SetBranchAddress("topCandidatesSync_sjNonWbtag", this->topCandidatesSync_sjNonWbtag); tree->SetBranchAddress("topCandidatesSync_Ropt", this->topCandidatesSync_Ropt); tree->SetBranchAddress("topCandidatesSync_RoptCalc", this->topCandidatesSync_RoptCalc); tree->SetBranchAddress("topCandidatesSync_masscal", this->topCandidatesSync_masscal); tree->SetBranchAddress("topCandidatesSync_ptcal", this->topCandidatesSync_ptcal); tree->SetBranchAddress("topCandidatesSync_sjW1phi", this->topCandidatesSync_sjW1phi); tree->SetBranchAddress("topCandidatesSync_sjW1pt", this->topCandidatesSync_sjW1pt); tree->SetBranchAddress("topCandidatesSync_sjNonWphi", this->topCandidatesSync_sjNonWphi); tree->SetBranchAddress("topCandidatesSync_delRopt", this->topCandidatesSync_delRopt); tree->SetBranchAddress("topCandidatesSync_sjW1eta", this->topCandidatesSync_sjW1eta); tree->SetBranchAddress("topCandidatesSync_fRec", this->topCandidatesSync_fRec); tree->SetBranchAddress("topCandidatesSync_phical", this->topCandidatesSync_phical); tree->SetBranchAddress("topCandidatesSync_sjW2phi", this->topCandidatesSync_sjW2phi); tree->SetBranchAddress("topCandidatesSync_eta", this->topCandidatesSync_eta); tree->SetBranchAddress("topCandidatesSync_n_subjettiness", this->topCandidatesSync_n_subjettiness); tree->SetBranchAddress("topCandidatesSync_sjW2ptcal", this->topCandidatesSync_sjW2ptcal); tree->SetBranchAddress("topCandidatesSync_bbtag", this->topCandidatesSync_bbtag); tree->SetBranchAddress("topCandidatesSync_sjW2eta", this->topCandidatesSync_sjW2eta); tree->SetBranchAddress("topCandidatesSync_genTopHad_dr", this->topCandidatesSync_genTopHad_dr); tree->SetBranchAddress("nll", &(this->nll)); tree->SetBranchAddress("ll_phi", this->ll_phi); tree->SetBranchAddress("ll_eta", this->ll_eta); tree->SetBranchAddress("ll_mass", this->ll_mass); tree->SetBranchAddress("ll_pt", this->ll_pt); tree->SetBranchAddress("nmem_ttbb_DL_0w2h2t", &(this->nmem_ttbb_DL_0w2h2t)); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_p", this->mem_ttbb_DL_0w2h2t_p); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_chi2", this->mem_ttbb_DL_0w2h2t_chi2); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_p_err", this->mem_ttbb_DL_0w2h2t_p_err); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_efficiency", this->mem_ttbb_DL_0w2h2t_efficiency); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_nperm", this->mem_ttbb_DL_0w2h2t_nperm); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_time", this->mem_ttbb_DL_0w2h2t_time); tree->SetBranchAddress("mem_ttbb_DL_0w2h2t_error_code", this->mem_ttbb_DL_0w2h2t_error_code); tree->SetBranchAddress("nmem_ttbb_SL_0w2h2t", &(this->nmem_ttbb_SL_0w2h2t)); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_p", this->mem_ttbb_SL_0w2h2t_p); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_chi2", this->mem_ttbb_SL_0w2h2t_chi2); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_p_err", this->mem_ttbb_SL_0w2h2t_p_err); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_efficiency", this->mem_ttbb_SL_0w2h2t_efficiency); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_nperm", this->mem_ttbb_SL_0w2h2t_nperm); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_time", this->mem_ttbb_SL_0w2h2t_time); tree->SetBranchAddress("mem_ttbb_SL_0w2h2t_error_code", this->mem_ttbb_SL_0w2h2t_error_code); tree->SetBranchAddress("nmem_ttbb_SL_1w2h2t", &(this->nmem_ttbb_SL_1w2h2t)); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_p", this->mem_ttbb_SL_1w2h2t_p); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_chi2", this->mem_ttbb_SL_1w2h2t_chi2); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_p_err", this->mem_ttbb_SL_1w2h2t_p_err); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_efficiency", this->mem_ttbb_SL_1w2h2t_efficiency); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_nperm", this->mem_ttbb_SL_1w2h2t_nperm); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_time", this->mem_ttbb_SL_1w2h2t_time); tree->SetBranchAddress("mem_ttbb_SL_1w2h2t_error_code", this->mem_ttbb_SL_1w2h2t_error_code); tree->SetBranchAddress("nmem_ttbb_SL_2w2h2t", &(this->nmem_ttbb_SL_2w2h2t)); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_p", this->mem_ttbb_SL_2w2h2t_p); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_chi2", this->mem_ttbb_SL_2w2h2t_chi2); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_p_err", this->mem_ttbb_SL_2w2h2t_p_err); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_efficiency", this->mem_ttbb_SL_2w2h2t_efficiency); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_nperm", this->mem_ttbb_SL_2w2h2t_nperm); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_time", this->mem_ttbb_SL_2w2h2t_time); tree->SetBranchAddress("mem_ttbb_SL_2w2h2t_error_code", this->mem_ttbb_SL_2w2h2t_error_code); tree->SetBranchAddress("nmem_tth_DL_0w2h2t", &(this->nmem_tth_DL_0w2h2t)); tree->SetBranchAddress("mem_tth_DL_0w2h2t_p", this->mem_tth_DL_0w2h2t_p); tree->SetBranchAddress("mem_tth_DL_0w2h2t_chi2", this->mem_tth_DL_0w2h2t_chi2); tree->SetBranchAddress("mem_tth_DL_0w2h2t_p_err", this->mem_tth_DL_0w2h2t_p_err); tree->SetBranchAddress("mem_tth_DL_0w2h2t_efficiency", this->mem_tth_DL_0w2h2t_efficiency); tree->SetBranchAddress("mem_tth_DL_0w2h2t_nperm", this->mem_tth_DL_0w2h2t_nperm); tree->SetBranchAddress("mem_tth_DL_0w2h2t_time", this->mem_tth_DL_0w2h2t_time); tree->SetBranchAddress("mem_tth_DL_0w2h2t_error_code", this->mem_tth_DL_0w2h2t_error_code); tree->SetBranchAddress("nmem_tth_SL_0w2h2t", &(this->nmem_tth_SL_0w2h2t)); tree->SetBranchAddress("mem_tth_SL_0w2h2t_p", this->mem_tth_SL_0w2h2t_p); tree->SetBranchAddress("mem_tth_SL_0w2h2t_chi2", this->mem_tth_SL_0w2h2t_chi2); tree->SetBranchAddress("mem_tth_SL_0w2h2t_p_err", this->mem_tth_SL_0w2h2t_p_err); tree->SetBranchAddress("mem_tth_SL_0w2h2t_efficiency", this->mem_tth_SL_0w2h2t_efficiency); tree->SetBranchAddress("mem_tth_SL_0w2h2t_nperm", this->mem_tth_SL_0w2h2t_nperm); tree->SetBranchAddress("mem_tth_SL_0w2h2t_time", this->mem_tth_SL_0w2h2t_time); tree->SetBranchAddress("mem_tth_SL_0w2h2t_error_code", this->mem_tth_SL_0w2h2t_error_code); tree->SetBranchAddress("nmem_tth_SL_1w2h2t", &(this->nmem_tth_SL_1w2h2t)); tree->SetBranchAddress("mem_tth_SL_1w2h2t_p", this->mem_tth_SL_1w2h2t_p); tree->SetBranchAddress("mem_tth_SL_1w2h2t_chi2", this->mem_tth_SL_1w2h2t_chi2); tree->SetBranchAddress("mem_tth_SL_1w2h2t_p_err", this->mem_tth_SL_1w2h2t_p_err); tree->SetBranchAddress("mem_tth_SL_1w2h2t_efficiency", this->mem_tth_SL_1w2h2t_efficiency); tree->SetBranchAddress("mem_tth_SL_1w2h2t_nperm", this->mem_tth_SL_1w2h2t_nperm); tree->SetBranchAddress("mem_tth_SL_1w2h2t_time", this->mem_tth_SL_1w2h2t_time); tree->SetBranchAddress("mem_tth_SL_1w2h2t_error_code", this->mem_tth_SL_1w2h2t_error_code); tree->SetBranchAddress("nmem_tth_SL_2w2h2t", &(this->nmem_tth_SL_2w2h2t)); tree->SetBranchAddress("mem_tth_SL_2w2h2t_p", this->mem_tth_SL_2w2h2t_p); tree->SetBranchAddress("mem_tth_SL_2w2h2t_chi2", this->mem_tth_SL_2w2h2t_chi2); tree->SetBranchAddress("mem_tth_SL_2w2h2t_p_err", this->mem_tth_SL_2w2h2t_p_err); tree->SetBranchAddress("mem_tth_SL_2w2h2t_efficiency", this->mem_tth_SL_2w2h2t_efficiency); tree->SetBranchAddress("mem_tth_SL_2w2h2t_nperm", this->mem_tth_SL_2w2h2t_nperm); tree->SetBranchAddress("mem_tth_SL_2w2h2t_time", this->mem_tth_SL_2w2h2t_time); tree->SetBranchAddress("mem_tth_SL_2w2h2t_error_code", this->mem_tth_SL_2w2h2t_error_code); tree->SetBranchAddress("nmet", &(this->nmet)); tree->SetBranchAddress("met_phi", this->met_phi); tree->SetBranchAddress("met_sumEt", this->met_sumEt); tree->SetBranchAddress("met_pt", this->met_pt); tree->SetBranchAddress("met_px", this->met_px); tree->SetBranchAddress("met_py", this->met_py); tree->SetBranchAddress("met_genPhi", this->met_genPhi); tree->SetBranchAddress("met_genPt", this->met_genPt); tree->SetBranchAddress("nmet_gen", &(this->nmet_gen)); tree->SetBranchAddress("met_gen_phi", this->met_gen_phi); tree->SetBranchAddress("met_gen_sumEt", this->met_gen_sumEt); tree->SetBranchAddress("met_gen_pt", this->met_gen_pt); tree->SetBranchAddress("met_gen_px", this->met_gen_px); tree->SetBranchAddress("met_gen_py", this->met_gen_py); tree->SetBranchAddress("met_gen_genPhi", this->met_gen_genPhi); tree->SetBranchAddress("met_gen_genPt", this->met_gen_genPt); tree->SetBranchAddress("nmet_jetcorr", &(this->nmet_jetcorr)); tree->SetBranchAddress("met_jetcorr_phi", this->met_jetcorr_phi); tree->SetBranchAddress("met_jetcorr_sumEt", this->met_jetcorr_sumEt); tree->SetBranchAddress("met_jetcorr_pt", this->met_jetcorr_pt); tree->SetBranchAddress("met_jetcorr_px", this->met_jetcorr_px); tree->SetBranchAddress("met_jetcorr_py", this->met_jetcorr_py); tree->SetBranchAddress("met_jetcorr_genPhi", this->met_jetcorr_genPhi); tree->SetBranchAddress("met_jetcorr_genPt", this->met_jetcorr_genPt); tree->SetBranchAddress("nmet_ttbar_gen", &(this->nmet_ttbar_gen)); tree->SetBranchAddress("met_ttbar_gen_phi", this->met_ttbar_gen_phi); tree->SetBranchAddress("met_ttbar_gen_sumEt", this->met_ttbar_gen_sumEt); tree->SetBranchAddress("met_ttbar_gen_pt", this->met_ttbar_gen_pt); tree->SetBranchAddress("met_ttbar_gen_px", this->met_ttbar_gen_px); tree->SetBranchAddress("met_ttbar_gen_py", this->met_ttbar_gen_py); tree->SetBranchAddress("met_ttbar_gen_genPhi", this->met_ttbar_gen_genPhi); tree->SetBranchAddress("met_ttbar_gen_genPt", this->met_ttbar_gen_genPt); tree->SetBranchAddress("npv", &(this->npv)); tree->SetBranchAddress("pv_z", this->pv_z); tree->SetBranchAddress("pv_isFake", this->pv_isFake); tree->SetBranchAddress("pv_rho", this->pv_rho); tree->SetBranchAddress("pv_ndof", this->pv_ndof); tree->SetBranchAddress("C", &(this->C)); tree->SetBranchAddress("D", &(this->D)); tree->SetBranchAddress("HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV0p45_v", &(this->HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV0p45_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV_p20_v", &(this->HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV_p20_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8DiPFJet280_200_TrimMass30_BTagCSV0p45_v", &(this->HLT_BIT_HLT_AK8DiPFJet280_200_TrimMass30_BTagCSV0p45_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV0p45_v", &(this->HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV0p45_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV_p20_v", &(this->HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV_p20_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8PFHT650_TrimR0p1PT0p03Mass50_v", &(this->HLT_BIT_HLT_AK8PFHT650_TrimR0p1PT0p03Mass50_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8PFHT700_TrimR0p1PT0p03Mass50_v", &(this->HLT_BIT_HLT_AK8PFHT700_TrimR0p1PT0p03Mass50_v)); tree->SetBranchAddress("HLT_BIT_HLT_AK8PFJet360_TrimMass30_v", &(this->HLT_BIT_HLT_AK8PFJet360_TrimMass30_v)); tree->SetBranchAddress("HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV0p72_v", &(this->HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV0p72_v)); tree->SetBranchAddress("HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV_p067_v", &(this->HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV_p067_v)); tree->SetBranchAddress("HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_v", &(this->HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiCentralPFJet55_PFMET110_NoiseCleaned_v", &(this->HLT_BIT_HLT_DiCentralPFJet55_PFMET110_NoiseCleaned_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiCentralPFJet55_PFMET110_v", &(this->HLT_BIT_HLT_DiCentralPFJet55_PFMET110_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve140_v", &(this->HLT_BIT_HLT_DiPFJetAve140_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve200_v", &(this->HLT_BIT_HLT_DiPFJetAve200_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve260_v", &(this->HLT_BIT_HLT_DiPFJetAve260_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve320_v", &(this->HLT_BIT_HLT_DiPFJetAve320_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve40_v", &(this->HLT_BIT_HLT_DiPFJetAve40_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve60_v", &(this->HLT_BIT_HLT_DiPFJetAve60_v)); tree->SetBranchAddress("HLT_BIT_HLT_DiPFJetAve80_v", &(this->HLT_BIT_HLT_DiPFJetAve80_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleEle24_22_eta2p1_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_DoubleEle24_22_eta2p1_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleIsoMu17_eta2p1_v", &(this->HLT_BIT_HLT_DoubleIsoMu17_eta2p1_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV0p67_v", &(this->HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV0p67_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV_p087_v", &(this->HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV_p087_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV0p67_v", &(this->HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV0p67_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV_p087_v", &(this->HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV_p087_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p85_DoublePFJetsC160_v", &(this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p85_DoublePFJetsC160_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p9_DoublePFJetsC100MaxDeta1p6_v", &(this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p9_DoublePFJetsC100MaxDeta1p6_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p014_DoublePFJetsC100MaxDeta1p6_v", &(this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p014_DoublePFJetsC100MaxDeta1p6_v)); tree->SetBranchAddress("HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p026_DoublePFJetsC160_v", &(this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p026_DoublePFJetsC160_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele105_CaloIdVT_GsfTrkIdT_v", &(this->HLT_BIT_HLT_Ele105_CaloIdVT_GsfTrkIdT_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele12_CaloIdL_TrackIdL_IsoVL_v", &(this->HLT_BIT_HLT_Ele12_CaloIdL_TrackIdL_IsoVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v", &(this->HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_v", &(this->HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele22_eta2p1_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_Ele22_eta2p1_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele22_eta2p1_WPTight_Gsf_v", &(this->HLT_BIT_HLT_Ele22_eta2p1_WPTight_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele23_CaloIdL_TrackIdL_IsoVL_v", &(this->HLT_BIT_HLT_Ele23_CaloIdL_TrackIdL_IsoVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v", &(this->HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_v", &(this->HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele23_WPLoose_Gsf_WHbbBoost_v", &(this->HLT_BIT_HLT_Ele23_WPLoose_Gsf_WHbbBoost_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele23_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_Ele23_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele25_WPTight_Gsf_v", &(this->HLT_BIT_HLT_Ele25_WPTight_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele25_eta2p1_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_Ele25_eta2p1_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele27_WPLoose_Gsf_WHbbBoost_v", &(this->HLT_BIT_HLT_Ele27_WPLoose_Gsf_WHbbBoost_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele27_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_Ele27_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v", &(this->HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_HT200_v", &(this->HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_HT200_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele27_eta2p1_WPTight_Gsf_v", &(this->HLT_BIT_HLT_Ele27_eta2p1_WPTight_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele30WP60_Ele8_Mass55_v", &(this->HLT_BIT_HLT_Ele30WP60_Ele8_Mass55_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v", &(this->HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_v", &(this->HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_v)); tree->SetBranchAddress("HLT_BIT_HLT_Ele45_CaloIdVT_GsfTrkIdT_PFJet200_PFJet50_v", &(this->HLT_BIT_HLT_Ele45_CaloIdVT_GsfTrkIdT_PFJet200_PFJet50_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu16_eta2p1_CaloMET30_v", &(this->HLT_BIT_HLT_IsoMu16_eta2p1_CaloMET30_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu18_v", &(this->HLT_BIT_HLT_IsoMu18_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu20_eta2p1_CentralPFJet30_BTagCSV07_v", &(this->HLT_BIT_HLT_IsoMu20_eta2p1_CentralPFJet30_BTagCSV07_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu20_eta2p1_v", &(this->HLT_BIT_HLT_IsoMu20_eta2p1_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu20_v", &(this->HLT_BIT_HLT_IsoMu20_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu24_eta2p1_CentralPFJet30_BTagCSV07_v", &(this->HLT_BIT_HLT_IsoMu24_eta2p1_CentralPFJet30_BTagCSV07_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu24_eta2p1_v", &(this->HLT_BIT_HLT_IsoMu24_eta2p1_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoMu27_v", &(this->HLT_BIT_HLT_IsoMu27_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoTkMu18_v", &(this->HLT_BIT_HLT_IsoTkMu18_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoTkMu20_v", &(this->HLT_BIT_HLT_IsoTkMu20_v)); tree->SetBranchAddress("HLT_BIT_HLT_IsoTkMu27_v", &(this->HLT_BIT_HLT_IsoTkMu27_v)); tree->SetBranchAddress("HLT_BIT_HLT_L1_TripleJet_VBF_v", &(this->HLT_BIT_HLT_L1_TripleJet_VBF_v)); tree->SetBranchAddress("HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET120_v", &(this->HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET120_v)); tree->SetBranchAddress("HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET80_v", &(this->HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET80_v)); tree->SetBranchAddress("HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_v", &(this->HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_v)); tree->SetBranchAddress("HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v", &(this->HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v", &(this->HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu16_eta2p1_CaloMET30_v", &(this->HLT_BIT_HLT_Mu16_eta2p1_CaloMET30_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu17_TkMu8_DZ_v", &(this->HLT_BIT_HLT_Mu17_TkMu8_DZ_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu17_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v", &(this->HLT_BIT_HLT_Mu17_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v", &(this->HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v", &(this->HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_DZ_v", &(this->HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_DZ_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_v", &(this->HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu20_v", &(this->HLT_BIT_HLT_Mu20_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu24_eta2p1_v", &(this->HLT_BIT_HLT_Mu24_eta2p1_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu24_v", &(this->HLT_BIT_HLT_Mu24_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu27_v", &(this->HLT_BIT_HLT_Mu27_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu40_eta2p1_PFJet200_PFJet50_v", &(this->HLT_BIT_HLT_Mu40_eta2p1_PFJet200_PFJet50_v)); tree->SetBranchAddress("HLT_BIT_HLT_Mu8_TrkIsoVVL_Ele17_CaloIdL_TrackIdL_IsoVL_v", &(this->HLT_BIT_HLT_Mu8_TrkIsoVVL_Ele17_CaloIdL_TrackIdL_IsoVL_v)); tree->SetBranchAddress("HLT_BIT_HLT_OldIsoMu18_v", &(this->HLT_BIT_HLT_OldIsoMu18_v)); tree->SetBranchAddress("HLT_BIT_HLT_OldIsoTkMu18_v", &(this->HLT_BIT_HLT_OldIsoTkMu18_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT350_PFMET100_NoiseCleaned_v", &(this->HLT_BIT_HLT_PFHT350_PFMET100_NoiseCleaned_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT350_PFMET100_v", &(this->HLT_BIT_HLT_PFHT350_PFMET100_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT350_v", &(this->HLT_BIT_HLT_PFHT350_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT400_SixJet30_BTagCSV0p55_2PFBTagCSV0p72_v", &(this->HLT_BIT_HLT_PFHT400_SixJet30_BTagCSV0p55_2PFBTagCSV0p72_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT400_SixJet30_DoubleBTagCSV_p056_v", &(this->HLT_BIT_HLT_PFHT400_SixJet30_DoubleBTagCSV_p056_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT400_SixJet30_v", &(this->HLT_BIT_HLT_PFHT400_SixJet30_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT450_SixJet40_BTagCSV_p056_v", &(this->HLT_BIT_HLT_PFHT450_SixJet40_BTagCSV_p056_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT450_SixJet40_PFBTagCSV0p72_v", &(this->HLT_BIT_HLT_PFHT450_SixJet40_PFBTagCSV0p72_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT450_SixJet40_v", &(this->HLT_BIT_HLT_PFHT450_SixJet40_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT650_WideJetMJJ900DEtaJJ1p5_v", &(this->HLT_BIT_HLT_PFHT650_WideJetMJJ900DEtaJJ1p5_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT650_WideJetMJJ950DEtaJJ1p5_v", &(this->HLT_BIT_HLT_PFHT650_WideJetMJJ950DEtaJJ1p5_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT750_4JetPt50_v", &(this->HLT_BIT_HLT_PFHT750_4JetPt50_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFHT800_v", &(this->HLT_BIT_HLT_PFHT800_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet140_v", &(this->HLT_BIT_HLT_PFJet140_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet200_v", &(this->HLT_BIT_HLT_PFJet200_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet260_v", &(this->HLT_BIT_HLT_PFJet260_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet320_v", &(this->HLT_BIT_HLT_PFJet320_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet400_v", &(this->HLT_BIT_HLT_PFJet400_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet40_v", &(this->HLT_BIT_HLT_PFJet40_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet450_v", &(this->HLT_BIT_HLT_PFJet450_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet60_v", &(this->HLT_BIT_HLT_PFJet60_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFJet80_v", &(this->HLT_BIT_HLT_PFJet80_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMET100_PFMHT100_IDTight_v", &(this->HLT_BIT_HLT_PFMET100_PFMHT100_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMET110_PFMHT110_IDTight_v", &(this->HLT_BIT_HLT_PFMET110_PFMHT110_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMET120_NoiseCleaned_Mu5_v", &(this->HLT_BIT_HLT_PFMET120_NoiseCleaned_Mu5_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMET120_PFMHT120_IDTight_v", &(this->HLT_BIT_HLT_PFMET120_PFMHT120_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMET170_NoiseCleaned_v", &(this->HLT_BIT_HLT_PFMET170_NoiseCleaned_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMET90_PFMHT90_IDTight_v", &(this->HLT_BIT_HLT_PFMET90_PFMHT90_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v", &(this->HLT_BIT_HLT_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v", &(this->HLT_BIT_HLT_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadJet45_DoubleBTagCSV0p67_v", &(this->HLT_BIT_HLT_QuadJet45_DoubleBTagCSV0p67_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadJet45_DoubleBTagCSV_p087_v", &(this->HLT_BIT_HLT_QuadJet45_DoubleBTagCSV_p087_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadJet45_TripleBTagCSV0p67_v", &(this->HLT_BIT_HLT_QuadJet45_TripleBTagCSV0p67_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadJet45_TripleBTagCSV_p087_v", &(this->HLT_BIT_HLT_QuadJet45_TripleBTagCSV_p087_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq460_v", &(this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq460_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq500_v", &(this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq500_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq200_v", &(this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq200_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq240_v", &(this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq240_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq200_v", &(this->HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq200_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq240_v", &(this->HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq240_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq460_v", &(this->HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq460_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq500_v", &(this->HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq500_v)); tree->SetBranchAddress("HLT_BIT_HLT_QuadPFJet_VBF_v", &(this->HLT_BIT_HLT_QuadPFJet_VBF_v)); tree->SetBranchAddress("HLT_BIT_HLT_TkMu20_v", &(this->HLT_BIT_HLT_TkMu20_v)); tree->SetBranchAddress("HLT_BIT_HLT_TkMu24_eta2p1_v", &(this->HLT_BIT_HLT_TkMu24_eta2p1_v)); tree->SetBranchAddress("HLT_BIT_HLT_TkMu27_v", &(this->HLT_BIT_HLT_TkMu27_v)); tree->SetBranchAddress("HLT_HH4bAll", &(this->HLT_HH4bAll)); tree->SetBranchAddress("HLT_HH4bHighLumi", &(this->HLT_HH4bHighLumi)); tree->SetBranchAddress("HLT_HH4bLowLumi", &(this->HLT_HH4bLowLumi)); tree->SetBranchAddress("HLT_VBFHbbAll", &(this->HLT_VBFHbbAll)); tree->SetBranchAddress("HLT_VBFHbbHighLumi", &(this->HLT_VBFHbbHighLumi)); tree->SetBranchAddress("HLT_VBFHbbLowLumi", &(this->HLT_VBFHbbLowLumi)); tree->SetBranchAddress("HLT_WenHbbAll", &(this->HLT_WenHbbAll)); tree->SetBranchAddress("HLT_WenHbbHighLumi", &(this->HLT_WenHbbHighLumi)); tree->SetBranchAddress("HLT_WenHbbLowLumi", &(this->HLT_WenHbbLowLumi)); tree->SetBranchAddress("HLT_WmnHbbAll", &(this->HLT_WmnHbbAll)); tree->SetBranchAddress("HLT_WmnHbbHighLumi", &(this->HLT_WmnHbbHighLumi)); tree->SetBranchAddress("HLT_WmnHbbLowLumi", &(this->HLT_WmnHbbLowLumi)); tree->SetBranchAddress("HLT_WtaunHbbAll", &(this->HLT_WtaunHbbAll)); tree->SetBranchAddress("HLT_WtaunHbbHighLumi", &(this->HLT_WtaunHbbHighLumi)); tree->SetBranchAddress("HLT_WtaunHbbLowLumi", &(this->HLT_WtaunHbbLowLumi)); tree->SetBranchAddress("HLT_ZeeHbbAll", &(this->HLT_ZeeHbbAll)); tree->SetBranchAddress("HLT_ZeeHbbHighLumi", &(this->HLT_ZeeHbbHighLumi)); tree->SetBranchAddress("HLT_ZeeHbbLowLumi", &(this->HLT_ZeeHbbLowLumi)); tree->SetBranchAddress("HLT_ZmmHbbAll", &(this->HLT_ZmmHbbAll)); tree->SetBranchAddress("HLT_ZmmHbbHighLumi", &(this->HLT_ZmmHbbHighLumi)); tree->SetBranchAddress("HLT_ZmmHbbLowLumi", &(this->HLT_ZmmHbbLowLumi)); tree->SetBranchAddress("HLT_ZnnHbb", &(this->HLT_ZnnHbb)); tree->SetBranchAddress("HLT_ZnnHbbAll", &(this->HLT_ZnnHbbAll)); tree->SetBranchAddress("HLT_hadronic", &(this->HLT_hadronic)); tree->SetBranchAddress("HLT_ttHhardonicAll", &(this->HLT_ttHhardonicAll)); tree->SetBranchAddress("HLT_ttHhardonicHighLumi", &(this->HLT_ttHhardonicHighLumi)); tree->SetBranchAddress("HLT_ttHhardonicLowLumi", &(this->HLT_ttHhardonicLowLumi)); tree->SetBranchAddress("HLT_ttHleptonic", &(this->HLT_ttHleptonic)); tree->SetBranchAddress("Wmass", &(this->Wmass)); tree->SetBranchAddress("aplanarity", &(this->aplanarity)); tree->SetBranchAddress("bTagWeight", &(this->bTagWeight)); tree->SetBranchAddress("bTagWeight_HFDown", &(this->bTagWeight_HFDown)); tree->SetBranchAddress("bTagWeight_HFStats1Down", &(this->bTagWeight_HFStats1Down)); tree->SetBranchAddress("bTagWeight_HFStats1Up", &(this->bTagWeight_HFStats1Up)); tree->SetBranchAddress("bTagWeight_HFStats2Down", &(this->bTagWeight_HFStats2Down)); tree->SetBranchAddress("bTagWeight_HFStats2Up", &(this->bTagWeight_HFStats2Up)); tree->SetBranchAddress("bTagWeight_HFUp", &(this->bTagWeight_HFUp)); tree->SetBranchAddress("bTagWeight_JESDown", &(this->bTagWeight_JESDown)); tree->SetBranchAddress("bTagWeight_JESUp", &(this->bTagWeight_JESUp)); tree->SetBranchAddress("bTagWeight_LFDown", &(this->bTagWeight_LFDown)); tree->SetBranchAddress("bTagWeight_LFStats1Down", &(this->bTagWeight_LFStats1Down)); tree->SetBranchAddress("bTagWeight_LFStats1Up", &(this->bTagWeight_LFStats1Up)); tree->SetBranchAddress("bTagWeight_LFStats2Down", &(this->bTagWeight_LFStats2Down)); tree->SetBranchAddress("bTagWeight_LFStats2Up", &(this->bTagWeight_LFStats2Up)); tree->SetBranchAddress("bTagWeight_LFUp", &(this->bTagWeight_LFUp)); tree->SetBranchAddress("bTagWeight_cErr1Down", &(this->bTagWeight_cErr1Down)); tree->SetBranchAddress("bTagWeight_cErr1Up", &(this->bTagWeight_cErr1Up)); tree->SetBranchAddress("bTagWeight_cErr2Down", &(this->bTagWeight_cErr2Down)); tree->SetBranchAddress("bTagWeight_cErr2Up", &(this->bTagWeight_cErr2Up)); tree->SetBranchAddress("btag_LR_4b_2b_btagCMVA", &(this->btag_LR_4b_2b_btagCMVA)); tree->SetBranchAddress("btag_LR_4b_2b_btagCMVA_log", &(this->btag_LR_4b_2b_btagCMVA_log)); tree->SetBranchAddress("btag_LR_4b_2b_btagCSV", &(this->btag_LR_4b_2b_btagCSV)); tree->SetBranchAddress("btag_lr_2b", &(this->btag_lr_2b)); tree->SetBranchAddress("btag_lr_4b", &(this->btag_lr_4b)); tree->SetBranchAddress("cat", &(this->cat)); tree->SetBranchAddress("cat_btag", &(this->cat_btag)); tree->SetBranchAddress("cat_gen", &(this->cat_gen)); tree->SetBranchAddress("common_bdt", &(this->common_bdt)); tree->SetBranchAddress("common_bdt_withmem1", &(this->common_bdt_withmem1)); tree->SetBranchAddress("common_bdt_withmem2", &(this->common_bdt_withmem2)); tree->SetBranchAddress("eta_drpair_btag", &(this->eta_drpair_btag)); tree->SetBranchAddress("evt", &(this->evt)); tree->SetBranchAddress("genHiggsDecayMode", &(this->genHiggsDecayMode)); tree->SetBranchAddress("genWeight", &(this->genWeight)); tree->SetBranchAddress("ht", &(this->ht)); tree->SetBranchAddress("is_dl", &(this->is_dl)); tree->SetBranchAddress("is_fh", &(this->is_fh)); tree->SetBranchAddress("is_sl", &(this->is_sl)); tree->SetBranchAddress("isotropy", &(this->isotropy)); tree->SetBranchAddress("json", &(this->json)); tree->SetBranchAddress("lumi", &(this->lumi)); tree->SetBranchAddress("mass_drpair_btag", &(this->mass_drpair_btag)); tree->SetBranchAddress("mean_bdisc", &(this->mean_bdisc)); tree->SetBranchAddress("mean_bdisc_btag", &(this->mean_bdisc_btag)); tree->SetBranchAddress("mean_dr_btag", &(this->mean_dr_btag)); tree->SetBranchAddress("min_dr_btag", &(this->min_dr_btag)); tree->SetBranchAddress("momentum_eig0", &(this->momentum_eig0)); tree->SetBranchAddress("momentum_eig1", &(this->momentum_eig1)); tree->SetBranchAddress("momentum_eig2", &(this->momentum_eig2)); tree->SetBranchAddress("nBCMVAL", &(this->nBCMVAL)); tree->SetBranchAddress("nBCMVAM", &(this->nBCMVAM)); tree->SetBranchAddress("nBCMVAT", &(this->nBCMVAT)); tree->SetBranchAddress("nBCSVL", &(this->nBCSVL)); tree->SetBranchAddress("nBCSVM", &(this->nBCSVM)); tree->SetBranchAddress("nBCSVT", &(this->nBCSVT)); tree->SetBranchAddress("nGenBHiggs", &(this->nGenBHiggs)); tree->SetBranchAddress("nGenBTop", &(this->nGenBTop)); tree->SetBranchAddress("nGenQW", &(this->nGenQW)); tree->SetBranchAddress("nMatchSimB", &(this->nMatchSimB)); tree->SetBranchAddress("nMatchSimC", &(this->nMatchSimC)); tree->SetBranchAddress("nMatch_hb", &(this->nMatch_hb)); tree->SetBranchAddress("nMatch_hb_btag", &(this->nMatch_hb_btag)); tree->SetBranchAddress("nMatch_tb", &(this->nMatch_tb)); tree->SetBranchAddress("nMatch_tb_btag", &(this->nMatch_tb_btag)); tree->SetBranchAddress("nMatch_wq", &(this->nMatch_wq)); tree->SetBranchAddress("nMatch_wq_btag", &(this->nMatch_wq_btag)); tree->SetBranchAddress("nPU0", &(this->nPU0)); tree->SetBranchAddress("nPVs", &(this->nPVs)); tree->SetBranchAddress("nSelected_hb", &(this->nSelected_hb)); tree->SetBranchAddress("nSelected_tb", &(this->nSelected_tb)); tree->SetBranchAddress("nSelected_wq", &(this->nSelected_wq)); tree->SetBranchAddress("nTrueInt", &(this->nTrueInt)); tree->SetBranchAddress("n_bjets", &(this->n_bjets)); tree->SetBranchAddress("n_boosted_bjets", &(this->n_boosted_bjets)); tree->SetBranchAddress("n_boosted_ljets", &(this->n_boosted_ljets)); tree->SetBranchAddress("n_excluded_bjets", &(this->n_excluded_bjets)); tree->SetBranchAddress("n_excluded_ljets", &(this->n_excluded_ljets)); tree->SetBranchAddress("n_ljets", &(this->n_ljets)); tree->SetBranchAddress("numJets", &(this->numJets)); tree->SetBranchAddress("passPV", &(this->passPV)); tree->SetBranchAddress("passes_btag", &(this->passes_btag)); tree->SetBranchAddress("passes_jet", &(this->passes_jet)); tree->SetBranchAddress("passes_mem", &(this->passes_mem)); tree->SetBranchAddress("pt_drpair_btag", &(this->pt_drpair_btag)); tree->SetBranchAddress("puWeight", &(this->puWeight)); tree->SetBranchAddress("qg_LR_flavour_4q_0q", &(this->qg_LR_flavour_4q_0q)); tree->SetBranchAddress("qg_LR_flavour_4q_0q_1q", &(this->qg_LR_flavour_4q_0q_1q)); tree->SetBranchAddress("qg_LR_flavour_4q_0q_1q_2q", &(this->qg_LR_flavour_4q_0q_1q_2q)); tree->SetBranchAddress("qg_LR_flavour_4q_0q_1q_2q_3q", &(this->qg_LR_flavour_4q_0q_1q_2q_3q)); tree->SetBranchAddress("qg_LR_flavour_4q_1q", &(this->qg_LR_flavour_4q_1q)); tree->SetBranchAddress("qg_LR_flavour_4q_1q_2q", &(this->qg_LR_flavour_4q_1q_2q)); tree->SetBranchAddress("qg_LR_flavour_4q_1q_2q_3q", &(this->qg_LR_flavour_4q_1q_2q_3q)); tree->SetBranchAddress("qg_LR_flavour_4q_2q", &(this->qg_LR_flavour_4q_2q)); tree->SetBranchAddress("qg_LR_flavour_4q_2q_3q", &(this->qg_LR_flavour_4q_2q_3q)); tree->SetBranchAddress("qg_LR_flavour_4q_3q", &(this->qg_LR_flavour_4q_3q)); tree->SetBranchAddress("rho", &(this->rho)); tree->SetBranchAddress("run", &(this->run)); tree->SetBranchAddress("sphericity", &(this->sphericity)); tree->SetBranchAddress("std_bdisc", &(this->std_bdisc)); tree->SetBranchAddress("std_bdisc_btag", &(this->std_bdisc_btag)); tree->SetBranchAddress("std_dr_btag", &(this->std_dr_btag)); tree->SetBranchAddress("triggerBitmask", &(this->triggerBitmask)); tree->SetBranchAddress("triggerDecision", &(this->triggerDecision)); tree->SetBranchAddress("ttCls", &(this->ttCls)); tree->SetBranchAddress("tth_mva", &(this->tth_mva)); tree->SetBranchAddress("xsec", &(this->xsec)); } //loadTree void init() { this->ncommon_mem = 0; for (int i=0; i < 1; i++) { this->common_mem_p_bkg[i] = 0; } for (int i=0; i < 1; i++) { this->common_mem_p[i] = 0; } for (int i=0; i < 1; i++) { this->common_mem_blr_4b[i] = 0; } for (int i=0; i < 1; i++) { this->common_mem_blr_2b[i] = 0; } for (int i=0; i < 1; i++) { this->common_mem_p_sig[i] = 0; } this->nfatjets = 0; for (int i=0; i < 4; i++) { this->fatjets_phi[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_pt[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_tau1[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_tau2[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_tau3[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_eta[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_mass[i] = 0; } for (int i=0; i < 4; i++) { this->fatjets_bbtag[i] = 0; } this->nfw_aj = 0; for (int i=0; i < 8; i++) { this->fw_aj_fw_h_alljets_nominal[i] = 0; } this->nfw_bj = 0; for (int i=0; i < 8; i++) { this->fw_bj_fw_h_btagjets_nominal[i] = 0; } this->nfw_uj = 0; for (int i=0; i < 8; i++) { this->fw_uj_fw_h_untagjets_nominal[i] = 0; } this->ngenHiggs = 0; for (int i=0; i < 2; i++) { this->genHiggs_phi[i] = 0; } for (int i=0; i < 2; i++) { this->genHiggs_eta[i] = 0; } for (int i=0; i < 2; i++) { this->genHiggs_mass[i] = 0; } for (int i=0; i < 2; i++) { this->genHiggs_id[i] = 0; } for (int i=0; i < 2; i++) { this->genHiggs_pt[i] = 0; } this->ngenTopHad = 0; for (int i=0; i < 2; i++) { this->genTopHad_phi[i] = 0; } for (int i=0; i < 2; i++) { this->genTopHad_eta[i] = 0; } for (int i=0; i < 2; i++) { this->genTopHad_mass[i] = 0; } for (int i=0; i < 2; i++) { this->genTopHad_pt[i] = 0; } for (int i=0; i < 2; i++) { this->genTopHad_decayMode[i] = 0; } this->ngenTopLep = 0; for (int i=0; i < 2; i++) { this->genTopLep_phi[i] = 0; } for (int i=0; i < 2; i++) { this->genTopLep_eta[i] = 0; } for (int i=0; i < 2; i++) { this->genTopLep_mass[i] = 0; } for (int i=0; i < 2; i++) { this->genTopLep_pt[i] = 0; } for (int i=0; i < 2; i++) { this->genTopLep_decayMode[i] = 0; } this->nhiggsCandidate = 0; for (int i=0; i < 4; i++) { this->higgsCandidate_sj1eta_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_mass_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2mass_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2pt_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2eta_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2pt_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2eta_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2mass_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2mass_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2eta_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2phi_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_mass_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1phi_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1eta_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_dr_top[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1mass_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_n_subjettiness[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2eta_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_dr_genHiggs[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj3pt_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2btag_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2eta_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2pt_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2mass_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj12masspt_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1pt_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2btag_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1pt_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1phi_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1mass_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_nallsubjets_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_dr_genTop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_nallsubjets_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1pt_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj3btag_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2btag_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1btag_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_eta[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1btag_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_nallsubjets_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj12massb_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1phi_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2pt_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj3phi_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2mass_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1pt_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_mass_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1eta_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1phi_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_mass_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_pt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1eta_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_nallsubjets_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1pt_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_tau2[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_tau3[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj3eta_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_tau1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_nallsubjets_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2btag_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1eta_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1btag_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2mass_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_nallsubjets_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2pt_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2pt_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2phi_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2phi_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1mass_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1pt_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1mass_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1btag_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1btag_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1eta_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2eta_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_secondbtag_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2btag_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2phi_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj3mass_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1mass_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1btag_pruned[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2phi_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj123masspt_subjetfiltered[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_phi[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1mass_softdropfilt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2phi_softdrop[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1phi_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj1phi_softdropz2b1filt[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_mass[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_sj2btag_softdropz2b1[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_bbtag[i] = 0; } for (int i=0; i < 4; i++) { this->higgsCandidate_mass_softdropz2b1[i] = 0; } this->njets = 0; for (int i=0; i < 16; i++) { this->jets_mcPt[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcEta[i] = 0; } for (int i=0; i < 16; i++) { this->jets_btagCMVA[i] = 0; } for (int i=0; i < 16; i++) { this->jets_id[i] = 0; } for (int i=0; i < 16; i++) { this->jets_btagFlag[i] = 0; } for (int i=0; i < 16; i++) { this->jets_pt[i] = 0; } for (int i=0; i < 16; i++) { this->jets_corr_JERDown[i] = 0; } for (int i=0; i < 16; i++) { this->jets_qgl[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcPhi[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcNumCHadrons[i] = 0; } for (int i=0; i < 16; i++) { this->jets_matchFlag[i] = 0; } for (int i=0; i < 16; i++) { this->jets_phi[i] = 0; } for (int i=0; i < 16; i++) { this->jets_matchBfromHadT[i] = 0; } for (int i=0; i < 16; i++) { this->jets_hadronFlavour[i] = 0; } for (int i=0; i < 16; i++) { this->jets_corr_JESUp[i] = 0; } for (int i=0; i < 16; i++) { this->jets_corr_JERUp[i] = 0; } for (int i=0; i < 16; i++) { this->jets_corr[i] = 0; } for (int i=0; i < 16; i++) { this->jets_corr_JER[i] = 0; } for (int i=0; i < 16; i++) { this->jets_corr_JESDown[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcM[i] = 0; } for (int i=0; i < 16; i++) { this->jets_btagCSV[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcMatchId[i] = 0; } for (int i=0; i < 16; i++) { this->jets_btagCMVA_log[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcNumBHadrons[i] = 0; } for (int i=0; i < 16; i++) { this->jets_eta[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mass[i] = 0; } for (int i=0; i < 16; i++) { this->jets_mcFlavour[i] = 0; } this->nleps = 0; for (int i=0; i < 2; i++) { this->leps_phi[i] = 0; } for (int i=0; i < 2; i++) { this->leps_pt[i] = 0; } for (int i=0; i < 2; i++) { this->leps_pdgId[i] = 0; } for (int i=0; i < 2; i++) { this->leps_relIso04[i] = 0; } for (int i=0; i < 2; i++) { this->leps_eta[i] = 0; } for (int i=0; i < 2; i++) { this->leps_mass[i] = 0; } for (int i=0; i < 2; i++) { this->leps_relIso03[i] = 0; } for (int i=0; i < 2; i++) { this->leps_mvaId[i] = 0; } this->nloose_jets = 0; for (int i=0; i < 6; i++) { this->loose_jets_mcPt[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcEta[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_btagCMVA[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_id[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_btagFlag[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_pt[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_corr_JERDown[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_qgl[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcPhi[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcNumCHadrons[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_matchFlag[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_phi[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_matchBfromHadT[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_hadronFlavour[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_corr_JESUp[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_corr_JERUp[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_corr[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_corr_JER[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_corr_JESDown[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcM[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_btagCSV[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcMatchId[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_btagCMVA_log[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcNumBHadrons[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_eta[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mass[i] = 0; } for (int i=0; i < 6; i++) { this->loose_jets_mcFlavour[i] = 0; } this->nmem_ttbb_DL_0w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_DL_0w2h2t_perm_perm_8[i] = 0; } this->nmem_ttbb_SL_0w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_0w2h2t_perm_perm_8[i] = 0; } this->nmem_ttbb_SL_1w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_1w2h2t_perm_perm_8[i] = 0; } this->nmem_ttbb_SL_2w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_ttbb_SL_2w2h2t_perm_perm_8[i] = 0; } this->nmem_tth_DL_0w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_DL_0w2h2t_perm_perm_8[i] = 0; } this->nmem_tth_SL_0w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_0w2h2t_perm_perm_8[i] = 0; } this->nmem_tth_SL_1w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_1w2h2t_perm_perm_8[i] = 0; } this->nmem_tth_SL_2w2h2t_perm = 0; for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_p_me_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_p_tf_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_idx[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_p_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_p_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_5[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_4[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_7[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_6[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_1[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_0[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_3[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_2[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_p_tf_mean[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_p_me_std[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_9[i] = 0; } for (int i=0; i < 50; i++) { this->mem_tth_SL_2w2h2t_perm_perm_8[i] = 0; } this->nothertopCandidate = 0; for (int i=0; i < 4; i++) { this->othertopCandidate_tau1[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_etacal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2btag[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_n_subjettiness_groomed[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2pt[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1ptcal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1btag[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1mass[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWmass[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWptcal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWeta[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_pt[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2masscal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_ptForRoptCalc[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_tau2[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_phi[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_tau3[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWpt[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWmasscal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1masscal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2mass[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_mass[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWbtag[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_Ropt[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_RoptCalc[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_masscal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_ptcal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1phi[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1pt[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjNonWphi[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_delRopt[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW1eta[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_fRec[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_phical[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2phi[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_eta[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_n_subjettiness[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2ptcal[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_bbtag[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_sjW2eta[i] = 0; } for (int i=0; i < 4; i++) { this->othertopCandidate_genTopHad_dr[i] = 0; } this->ntopCandidate = 0; for (int i=0; i < 1; i++) { this->topCandidate_tau1[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_etacal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2btag[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_n_subjettiness_groomed[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2pt[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1ptcal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1btag[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1mass[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWmass[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWptcal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWeta[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_pt[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2masscal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_ptForRoptCalc[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_tau2[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_phi[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_tau3[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWpt[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWmasscal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1masscal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2mass[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_mass[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWbtag[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_Ropt[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_RoptCalc[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_masscal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_ptcal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1phi[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1pt[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjNonWphi[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_delRopt[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW1eta[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_fRec[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_phical[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2phi[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_eta[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_n_subjettiness[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2ptcal[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_bbtag[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_sjW2eta[i] = 0; } for (int i=0; i < 1; i++) { this->topCandidate_genTopHad_dr[i] = 0; } this->ntopCandidatesSync = 0; for (int i=0; i < 4; i++) { this->topCandidatesSync_tau1[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_etacal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2btag[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_n_subjettiness_groomed[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2pt[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1ptcal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1btag[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1mass[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWmass[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWptcal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWeta[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_pt[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2masscal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_ptForRoptCalc[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_tau2[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_phi[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_tau3[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWpt[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWmasscal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1masscal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2mass[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_mass[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWbtag[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_Ropt[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_RoptCalc[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_masscal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_ptcal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1phi[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1pt[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjNonWphi[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_delRopt[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW1eta[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_fRec[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_phical[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2phi[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_eta[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_n_subjettiness[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2ptcal[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_bbtag[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_sjW2eta[i] = 0; } for (int i=0; i < 4; i++) { this->topCandidatesSync_genTopHad_dr[i] = 0; } this->nll = 0; for (int i=0; i < 1; i++) { this->ll_phi[i] = 0; } for (int i=0; i < 1; i++) { this->ll_eta[i] = 0; } for (int i=0; i < 1; i++) { this->ll_mass[i] = 0; } for (int i=0; i < 1; i++) { this->ll_pt[i] = 0; } this->nmem_ttbb_DL_0w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_DL_0w2h2t_error_code[i] = 0; } this->nmem_ttbb_SL_0w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_0w2h2t_error_code[i] = 0; } this->nmem_ttbb_SL_1w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_1w2h2t_error_code[i] = 0; } this->nmem_ttbb_SL_2w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_ttbb_SL_2w2h2t_error_code[i] = 0; } this->nmem_tth_DL_0w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_DL_0w2h2t_error_code[i] = 0; } this->nmem_tth_SL_0w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_0w2h2t_error_code[i] = 0; } this->nmem_tth_SL_1w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_1w2h2t_error_code[i] = 0; } this->nmem_tth_SL_2w2h2t = 0; for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_p[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_chi2[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_p_err[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_efficiency[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_nperm[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_time[i] = 0; } for (int i=0; i < 1; i++) { this->mem_tth_SL_2w2h2t_error_code[i] = 0; } this->nmet = 0; for (int i=0; i < 1; i++) { this->met_phi[i] = 0; } for (int i=0; i < 1; i++) { this->met_sumEt[i] = 0; } for (int i=0; i < 1; i++) { this->met_pt[i] = 0; } for (int i=0; i < 1; i++) { this->met_px[i] = 0; } for (int i=0; i < 1; i++) { this->met_py[i] = 0; } for (int i=0; i < 1; i++) { this->met_genPhi[i] = 0; } for (int i=0; i < 1; i++) { this->met_genPt[i] = 0; } this->nmet_gen = 0; for (int i=0; i < 1; i++) { this->met_gen_phi[i] = 0; } for (int i=0; i < 1; i++) { this->met_gen_sumEt[i] = 0; } for (int i=0; i < 1; i++) { this->met_gen_pt[i] = 0; } for (int i=0; i < 1; i++) { this->met_gen_px[i] = 0; } for (int i=0; i < 1; i++) { this->met_gen_py[i] = 0; } for (int i=0; i < 1; i++) { this->met_gen_genPhi[i] = 0; } for (int i=0; i < 1; i++) { this->met_gen_genPt[i] = 0; } this->nmet_jetcorr = 0; for (int i=0; i < 1; i++) { this->met_jetcorr_phi[i] = 0; } for (int i=0; i < 1; i++) { this->met_jetcorr_sumEt[i] = 0; } for (int i=0; i < 1; i++) { this->met_jetcorr_pt[i] = 0; } for (int i=0; i < 1; i++) { this->met_jetcorr_px[i] = 0; } for (int i=0; i < 1; i++) { this->met_jetcorr_py[i] = 0; } for (int i=0; i < 1; i++) { this->met_jetcorr_genPhi[i] = 0; } for (int i=0; i < 1; i++) { this->met_jetcorr_genPt[i] = 0; } this->nmet_ttbar_gen = 0; for (int i=0; i < 1; i++) { this->met_ttbar_gen_phi[i] = 0; } for (int i=0; i < 1; i++) { this->met_ttbar_gen_sumEt[i] = 0; } for (int i=0; i < 1; i++) { this->met_ttbar_gen_pt[i] = 0; } for (int i=0; i < 1; i++) { this->met_ttbar_gen_px[i] = 0; } for (int i=0; i < 1; i++) { this->met_ttbar_gen_py[i] = 0; } for (int i=0; i < 1; i++) { this->met_ttbar_gen_genPhi[i] = 0; } for (int i=0; i < 1; i++) { this->met_ttbar_gen_genPt[i] = 0; } this->npv = 0; for (int i=0; i < 1; i++) { this->pv_z[i] = 0; } for (int i=0; i < 1; i++) { this->pv_isFake[i] = 0; } for (int i=0; i < 1; i++) { this->pv_rho[i] = 0; } for (int i=0; i < 1; i++) { this->pv_ndof[i] = 0; } this->C = 0; this->D = 0; this->HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV0p45_v = 0; this->HLT_BIT_HLT_AK8DiPFJet250_200_TrimMass30_BTagCSV_p20_v = 0; this->HLT_BIT_HLT_AK8DiPFJet280_200_TrimMass30_BTagCSV0p45_v = 0; this->HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV0p45_v = 0; this->HLT_BIT_HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV_p20_v = 0; this->HLT_BIT_HLT_AK8PFHT650_TrimR0p1PT0p03Mass50_v = 0; this->HLT_BIT_HLT_AK8PFHT700_TrimR0p1PT0p03Mass50_v = 0; this->HLT_BIT_HLT_AK8PFJet360_TrimMass30_v = 0; this->HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV0p72_v = 0; this->HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_BTagCSV_p067_v = 0; this->HLT_BIT_HLT_CaloMHTNoPU90_PFMET90_PFMHT90_IDTight_v = 0; this->HLT_BIT_HLT_DiCentralPFJet55_PFMET110_NoiseCleaned_v = 0; this->HLT_BIT_HLT_DiCentralPFJet55_PFMET110_v = 0; this->HLT_BIT_HLT_DiPFJetAve140_v = 0; this->HLT_BIT_HLT_DiPFJetAve200_v = 0; this->HLT_BIT_HLT_DiPFJetAve260_v = 0; this->HLT_BIT_HLT_DiPFJetAve320_v = 0; this->HLT_BIT_HLT_DiPFJetAve40_v = 0; this->HLT_BIT_HLT_DiPFJetAve60_v = 0; this->HLT_BIT_HLT_DiPFJetAve80_v = 0; this->HLT_BIT_HLT_DoubleEle24_22_eta2p1_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_DoubleIsoMu17_eta2p1_v = 0; this->HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV0p67_v = 0; this->HLT_BIT_HLT_DoubleJet90_Double30_DoubleBTagCSV_p087_v = 0; this->HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV0p67_v = 0; this->HLT_BIT_HLT_DoubleJet90_Double30_TripleBTagCSV_p087_v = 0; this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p85_DoublePFJetsC160_v = 0; this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV0p9_DoublePFJetsC100MaxDeta1p6_v = 0; this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p014_DoublePFJetsC100MaxDeta1p6_v = 0; this->HLT_BIT_HLT_DoubleJetsC100_DoubleBTagCSV_p026_DoublePFJetsC160_v = 0; this->HLT_BIT_HLT_Ele105_CaloIdVT_GsfTrkIdT_v = 0; this->HLT_BIT_HLT_Ele12_CaloIdL_TrackIdL_IsoVL_v = 0; this->HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v = 0; this->HLT_BIT_HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_v = 0; this->HLT_BIT_HLT_Ele22_eta2p1_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_Ele22_eta2p1_WPTight_Gsf_v = 0; this->HLT_BIT_HLT_Ele23_CaloIdL_TrackIdL_IsoVL_v = 0; this->HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v = 0; this->HLT_BIT_HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_v = 0; this->HLT_BIT_HLT_Ele23_WPLoose_Gsf_WHbbBoost_v = 0; this->HLT_BIT_HLT_Ele23_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_Ele25_WPTight_Gsf_v = 0; this->HLT_BIT_HLT_Ele25_eta2p1_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_Ele27_WPLoose_Gsf_WHbbBoost_v = 0; this->HLT_BIT_HLT_Ele27_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v = 0; this->HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_HT200_v = 0; this->HLT_BIT_HLT_Ele27_eta2p1_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_Ele27_eta2p1_WPTight_Gsf_v = 0; this->HLT_BIT_HLT_Ele30WP60_Ele8_Mass55_v = 0; this->HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_CentralPFJet30_BTagCSV07_v = 0; this->HLT_BIT_HLT_Ele32_eta2p1_WPLoose_Gsf_v = 0; this->HLT_BIT_HLT_Ele45_CaloIdVT_GsfTrkIdT_PFJet200_PFJet50_v = 0; this->HLT_BIT_HLT_IsoMu16_eta2p1_CaloMET30_v = 0; this->HLT_BIT_HLT_IsoMu18_v = 0; this->HLT_BIT_HLT_IsoMu20_eta2p1_CentralPFJet30_BTagCSV07_v = 0; this->HLT_BIT_HLT_IsoMu20_eta2p1_v = 0; this->HLT_BIT_HLT_IsoMu20_v = 0; this->HLT_BIT_HLT_IsoMu24_eta2p1_CentralPFJet30_BTagCSV07_v = 0; this->HLT_BIT_HLT_IsoMu24_eta2p1_v = 0; this->HLT_BIT_HLT_IsoMu27_v = 0; this->HLT_BIT_HLT_IsoTkMu18_v = 0; this->HLT_BIT_HLT_IsoTkMu20_v = 0; this->HLT_BIT_HLT_IsoTkMu27_v = 0; this->HLT_BIT_HLT_L1_TripleJet_VBF_v = 0; this->HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET120_v = 0; this->HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_MET80_v = 0; this->HLT_BIT_HLT_LooseIsoPFTau50_Trk30_eta2p1_v = 0; this->HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v = 0; this->HLT_BIT_HLT_MonoCentralPFJet80_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v = 0; this->HLT_BIT_HLT_Mu16_eta2p1_CaloMET30_v = 0; this->HLT_BIT_HLT_Mu17_TkMu8_DZ_v = 0; this->HLT_BIT_HLT_Mu17_TrkIsoVVL_Ele12_CaloIdL_TrackIdL_IsoVL_v = 0; this->HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v = 0; this->HLT_BIT_HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v = 0; this->HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_DZ_v = 0; this->HLT_BIT_HLT_Mu17_TrkIsoVVL_TkMu8_TrkIsoVVL_v = 0; this->HLT_BIT_HLT_Mu20_v = 0; this->HLT_BIT_HLT_Mu24_eta2p1_v = 0; this->HLT_BIT_HLT_Mu24_v = 0; this->HLT_BIT_HLT_Mu27_v = 0; this->HLT_BIT_HLT_Mu40_eta2p1_PFJet200_PFJet50_v = 0; this->HLT_BIT_HLT_Mu8_TrkIsoVVL_Ele17_CaloIdL_TrackIdL_IsoVL_v = 0; this->HLT_BIT_HLT_OldIsoMu18_v = 0; this->HLT_BIT_HLT_OldIsoTkMu18_v = 0; this->HLT_BIT_HLT_PFHT350_PFMET100_NoiseCleaned_v = 0; this->HLT_BIT_HLT_PFHT350_PFMET100_v = 0; this->HLT_BIT_HLT_PFHT350_v = 0; this->HLT_BIT_HLT_PFHT400_SixJet30_BTagCSV0p55_2PFBTagCSV0p72_v = 0; this->HLT_BIT_HLT_PFHT400_SixJet30_DoubleBTagCSV_p056_v = 0; this->HLT_BIT_HLT_PFHT400_SixJet30_v = 0; this->HLT_BIT_HLT_PFHT450_SixJet40_BTagCSV_p056_v = 0; this->HLT_BIT_HLT_PFHT450_SixJet40_PFBTagCSV0p72_v = 0; this->HLT_BIT_HLT_PFHT450_SixJet40_v = 0; this->HLT_BIT_HLT_PFHT650_WideJetMJJ900DEtaJJ1p5_v = 0; this->HLT_BIT_HLT_PFHT650_WideJetMJJ950DEtaJJ1p5_v = 0; this->HLT_BIT_HLT_PFHT750_4JetPt50_v = 0; this->HLT_BIT_HLT_PFHT800_v = 0; this->HLT_BIT_HLT_PFJet140_v = 0; this->HLT_BIT_HLT_PFJet200_v = 0; this->HLT_BIT_HLT_PFJet260_v = 0; this->HLT_BIT_HLT_PFJet320_v = 0; this->HLT_BIT_HLT_PFJet400_v = 0; this->HLT_BIT_HLT_PFJet40_v = 0; this->HLT_BIT_HLT_PFJet450_v = 0; this->HLT_BIT_HLT_PFJet60_v = 0; this->HLT_BIT_HLT_PFJet80_v = 0; this->HLT_BIT_HLT_PFMET100_PFMHT100_IDTight_v = 0; this->HLT_BIT_HLT_PFMET110_PFMHT110_IDTight_v = 0; this->HLT_BIT_HLT_PFMET120_NoiseCleaned_Mu5_v = 0; this->HLT_BIT_HLT_PFMET120_PFMHT120_IDTight_v = 0; this->HLT_BIT_HLT_PFMET170_NoiseCleaned_v = 0; this->HLT_BIT_HLT_PFMET90_PFMHT90_IDTight_v = 0; this->HLT_BIT_HLT_PFMETNoMu120_NoiseCleaned_PFMHTNoMu120_IDTight_v = 0; this->HLT_BIT_HLT_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v = 0; this->HLT_BIT_HLT_QuadJet45_DoubleBTagCSV0p67_v = 0; this->HLT_BIT_HLT_QuadJet45_DoubleBTagCSV_p087_v = 0; this->HLT_BIT_HLT_QuadJet45_TripleBTagCSV0p67_v = 0; this->HLT_BIT_HLT_QuadJet45_TripleBTagCSV_p087_v = 0; this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq460_v = 0; this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_VBF_Mqq500_v = 0; this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq200_v = 0; this->HLT_BIT_HLT_QuadPFJet_BTagCSV_p016_p11_VBF_Mqq240_v = 0; this->HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq200_v = 0; this->HLT_BIT_HLT_QuadPFJet_DoubleBTagCSV_VBF_Mqq240_v = 0; this->HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq460_v = 0; this->HLT_BIT_HLT_QuadPFJet_SingleBTagCSV_VBF_Mqq500_v = 0; this->HLT_BIT_HLT_QuadPFJet_VBF_v = 0; this->HLT_BIT_HLT_TkMu20_v = 0; this->HLT_BIT_HLT_TkMu24_eta2p1_v = 0; this->HLT_BIT_HLT_TkMu27_v = 0; this->HLT_HH4bAll = 0; this->HLT_HH4bHighLumi = 0; this->HLT_HH4bLowLumi = 0; this->HLT_VBFHbbAll = 0; this->HLT_VBFHbbHighLumi = 0; this->HLT_VBFHbbLowLumi = 0; this->HLT_WenHbbAll = 0; this->HLT_WenHbbHighLumi = 0; this->HLT_WenHbbLowLumi = 0; this->HLT_WmnHbbAll = 0; this->HLT_WmnHbbHighLumi = 0; this->HLT_WmnHbbLowLumi = 0; this->HLT_WtaunHbbAll = 0; this->HLT_WtaunHbbHighLumi = 0; this->HLT_WtaunHbbLowLumi = 0; this->HLT_ZeeHbbAll = 0; this->HLT_ZeeHbbHighLumi = 0; this->HLT_ZeeHbbLowLumi = 0; this->HLT_ZmmHbbAll = 0; this->HLT_ZmmHbbHighLumi = 0; this->HLT_ZmmHbbLowLumi = 0; this->HLT_ZnnHbb = 0; this->HLT_ZnnHbbAll = 0; this->HLT_hadronic = 0; this->HLT_ttHhardonicAll = 0; this->HLT_ttHhardonicHighLumi = 0; this->HLT_ttHhardonicLowLumi = 0; this->HLT_ttHleptonic = 0; this->Wmass = 0; this->aplanarity = 0; this->bTagWeight = 0; this->bTagWeight_HFDown = 0; this->bTagWeight_HFStats1Down = 0; this->bTagWeight_HFStats1Up = 0; this->bTagWeight_HFStats2Down = 0; this->bTagWeight_HFStats2Up = 0; this->bTagWeight_HFUp = 0; this->bTagWeight_JESDown = 0; this->bTagWeight_JESUp = 0; this->bTagWeight_LFDown = 0; this->bTagWeight_LFStats1Down = 0; this->bTagWeight_LFStats1Up = 0; this->bTagWeight_LFStats2Down = 0; this->bTagWeight_LFStats2Up = 0; this->bTagWeight_LFUp = 0; this->bTagWeight_cErr1Down = 0; this->bTagWeight_cErr1Up = 0; this->bTagWeight_cErr2Down = 0; this->bTagWeight_cErr2Up = 0; this->btag_LR_4b_2b_btagCMVA = 0; this->btag_LR_4b_2b_btagCMVA_log = 0; this->btag_LR_4b_2b_btagCSV = 0; this->btag_lr_2b = 0; this->btag_lr_4b = 0; this->cat = 0; this->cat_btag = 0; this->cat_gen = 0; this->common_bdt = 0; this->common_bdt_withmem1 = 0; this->common_bdt_withmem2 = 0; this->eta_drpair_btag = 0; this->evt = 0; this->genHiggsDecayMode = 0; this->genWeight = 0; this->ht = 0; this->is_dl = 0; this->is_fh = 0; this->is_sl = 0; this->isotropy = 0; this->json = 0; this->lumi = 0; this->mass_drpair_btag = 0; this->mean_bdisc = 0; this->mean_bdisc_btag = 0; this->mean_dr_btag = 0; this->min_dr_btag = 0; this->momentum_eig0 = 0; this->momentum_eig1 = 0; this->momentum_eig2 = 0; this->nBCMVAL = 0; this->nBCMVAM = 0; this->nBCMVAT = 0; this->nBCSVL = 0; this->nBCSVM = 0; this->nBCSVT = 0; this->nGenBHiggs = 0; this->nGenBTop = 0; this->nGenQW = 0; this->nMatchSimB = 0; this->nMatchSimC = 0; this->nMatch_hb = 0; this->nMatch_hb_btag = 0; this->nMatch_tb = 0; this->nMatch_tb_btag = 0; this->nMatch_wq = 0; this->nMatch_wq_btag = 0; this->nPU0 = 0; this->nPVs = 0; this->nSelected_hb = 0; this->nSelected_tb = 0; this->nSelected_wq = 0; this->nTrueInt = 0; this->n_bjets = 0; this->n_boosted_bjets = 0; this->n_boosted_ljets = 0; this->n_excluded_bjets = 0; this->n_excluded_ljets = 0; this->n_ljets = 0; this->numJets = 0; this->passPV = 0; this->passes_btag = 0; this->passes_jet = 0; this->passes_mem = 0; this->pt_drpair_btag = 0; this->puWeight = 0; this->qg_LR_flavour_4q_0q = 0; this->qg_LR_flavour_4q_0q_1q = 0; this->qg_LR_flavour_4q_0q_1q_2q = 0; this->qg_LR_flavour_4q_0q_1q_2q_3q = 0; this->qg_LR_flavour_4q_1q = 0; this->qg_LR_flavour_4q_1q_2q = 0; this->qg_LR_flavour_4q_1q_2q_3q = 0; this->qg_LR_flavour_4q_2q = 0; this->qg_LR_flavour_4q_2q_3q = 0; this->qg_LR_flavour_4q_3q = 0; this->rho = 0; this->run = 0; this->sphericity = 0; this->std_bdisc = 0; this->std_bdisc_btag = 0; this->std_dr_btag = 0; this->triggerBitmask = 0; this->triggerDecision = 0; this->ttCls = 0; this->tth_mva = 0; this->xsec = 0; } //init }; //class #endif
#pragma once #include <map> #include <string> #include <vector> namespace mvm0 { constexpr std::size_t SYM_NONE = static_cast<std::size_t>(-1); struct Ins { std::size_t def_sym; // symbol id If ins has a symbol, SYM_NONE otherwhise std::size_t use_sym; // symbol id if one operand is a symbol, SYM_NONE otherwhise std::string name; std::vector<int> args; }; struct ROM { std::vector<Ins> ins; std::vector<std::size_t> sym_defs; // mapping symbol idx => ins idx std::vector<std::string> syms; // mapping symbol idx => name std::map<std::string, std::size_t> smap; // mapping symbol name => idx }; } // namespace mvm0
//////////////////////////////////////////////////////////////////////////////// #include "dijkstra.h" #include <igl/edges.h> #include <vector> #include <queue> //////////////////////////////////////////////////////////////////////////////// namespace cellogram { // ----------------------------------------------------------------------------- // Dijkstra. One-to-all shortest path in positive weighted graph. O(m*log(n)) void dijkstra(std::vector<std::vector<edge> > &graph, std::vector<int> &prev, std::vector<int> &dist, int source) { std::priority_queue<edge> file; std::vector<bool> mark(graph.size(), false); prev.assign(graph.size(), -1); dist.assign(graph.size(), INT_MAX); file.push(edge(source, source, 0)); while (not file.empty()) { edge e = file.top(); file.pop(); if (mark[e.y]) continue; prev[e.y] = e.x; dist[e.y] = e.w; // Distance form source is now correct mark[e.y] = true; for (int i = 0; i < (int) graph[e.y].size(); i++) { edge f = graph[e.y][i]; f.w += e.w; if (dist[f.y] > f.w) file.push(f); } } } // ----------------------------------------------------------------------------- std::vector<std::vector<int>> adjacency_graph(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) { Eigen::MatrixXi E; igl::edges(F, E); std::vector<std::vector<int>> adj(V.rows()); for (int e = 0; e < E.rows(); ++e) { int x = E(e, 0); int y = E(e, 1); adj[x].push_back(y); adj[y].push_back(x); } return adj; } // ----------------------------------------------------------------------------- void dijkstra_grading(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, Eigen::VectorXd &S, double grading, const std::vector<int> &sources) { typedef std::pair<int, int> Segment; typedef std::pair<double, Segment> WeightedSegment; std::priority_queue<WeightedSegment> q; size_t n = V.rows(); std::vector<bool> marked(n, false); for (int x : sources) { q.emplace(0, Segment(x, x)); } auto adj = adjacency_graph(V, F); while (!q.empty()) { auto kv = q.top(); q.pop(); int x = kv.second.first; int y = kv.second.second; double dist = -kv.first; if (marked[y]) { continue; } marked[y] = true; S[y] = S[x] + dist * grading; for (int z : adj[y]) { dist += (V.row(y) - V.row(z)).norm(); q.emplace(-dist, Segment(x, z)); } } } } // namespace cellogram